Wednesday 19 April 2017

Get Started with Docker in Ubuntu






1. $sudo apt install docker.io

An image is a lightweight, stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config fil

A container is a runtime instance of an image – what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so.

2. $sudo docker run hello-world
to run your first app in docker

3. $sudo docker images
To see the installed images

4. $docker --help
To see the list of commands in docker

5. $sudo docker run -it fedora bash
   $sudo docker run -it ubuntu bash
To lauch terminal with fedora's instance.

6. $sudo docker inspect fedora
To get the details of the fedora image

7. $sudo docker version
To get the version

8. $sudo docker ps
To see the container id and other details

9. $sudo docker stop
To gracefully stop the container

10. $ sudo docker history fedora
Shows history of images



Refrences :
1. https://docs.docker.com/engine/reference/commandline/container_start/#parent-command
2. https://docs.docker.com/engine/userguide/