Tuesday, May 7, 2019

Getting Started with Docker

Getting Started with Docker:

In this post we are going to try few basic commands in docker.You can download the Docker by following the link. Once you download and install the  docker in you system.


Playing with Hello World:


Once the docker is installed we are going to run a hello-world container on our system.Lets run the following command:


docker pull hello-world

Example:



The "Pull" command fetches the hello-world image from the docker registry and saves it in our system. To see list docker images installed in our system use "docker images" command.

docker images

Example:



Now we have hello-world container installed.Lets run the image docker container using run command

docker run hello-world


Example:


Now we see hello from the docker container.When we run the above command docker client open the virtual machines run the command and killing.which all happened so fast.

To see list of actively running container use "docker ps" command.since there is no container actively running we are seeing nothing.
 

docker ps


Example:


We will add some flavours with the above command -a. we will list of container we have and the commands we have tried.


docker ps -a


Example:


To Remove docker container use "docker rm container-id" command.

Example:



If have multiple container and want to remove all at once use "docker container prune" command.


2 comments: