Blog

20th May 2018

Key Docker Commands

Install Docker Machine

Follow the instruction here and install the Docker Machine in Windows,Mac and Linux.

https://github.com/docker/machine/releases

Key Docker Machine Commands

docker-machine version

docker-machine ls

docker-machine start [machine name]

docker-machine stop [machine name]

docker-machine env [machine name]

docker-machine start [machine name]

docker-machine ip [machine name]

docker-machine rm [machine name]

How to create docker machine?

We have to install the oracle virtual machine. Before we create the docker machine. Follow the document to create the docker machine Oracle VM

After successful installation of Oracle VM. Execute the following command to create the docker machine.

docker-machine create default

Key Docker Client Commands

docker pull [image name]  (This command will pull the docker image from repository)

docker run [image name] (This command will run the image as container)

docker images (This command will list all docker images)

docker rmi [image id] (this command will help us to remove the unwanted images)

docker ps (This command will list all docker running containers)

docker ps -a (This command will list all docker containers)

docker rm [container id] (this command will help us to remove the unwanted container)

docker (This command will list all available commands)

docker stop $(docker ps -aq) (This command will stop all docker containers)

docker rm $(docker ps -aq) (This command will remove all docker containers)

docker rmi $(docker images -q) (This command will remove all docker images)

How can I get docker IP address?

Execute the following command inorder to get the ip address

docker inspect [container id] | grep "IPAddress"

 

Docker
About Christin

Leave a Reply

Your email address will not be published. Required fields are marked *