Top 15 Docker Commands – Docker Commands Tutorial – Edureka

In my previous blogs, I’ve covered what Docker is and how you can use it. Today, in this blog, I’ll talk about the 15 best Docker commands you’ll use frequently while working with Docker. The Docker container trend has been growing irrepressibly with organizations actively looking for professionals who possess Docker certification training and a solid knowledge of these Docker commands will give you the necessary expertise.

The following are the commands being covered:

docker -version docker pull docker run docker ps docker

  • ps -a
  • docker exec docker stop docker kill docker

  • commit
  • docker

  • login
  • docker push
  • Images
  • of Docker Docker RM Docker

  • RMI
  • Building
  • Docker So, let’s get started:Docker commands 1. docker -version This command is used to get the currently installed version of Docker

<img src=”” alt=”Docker_Version – Docker Commands – Edureka” />3. Running Docker

Usage: docker run -it -d

<image name>

This command is used to create a container from an image

<img src=”” alt=”Docker_Pull – Docker commands – Edureka” />4. Docker PS

This command is used to enumerate

running containers docker_run - Docker - Edureka5 commands. Docker PS-A

This command is used to display all

running and exited containers <img src=”” alt=”docker_ps – Docker – Edureka” />6 commands.

docker exec

Usage: docker exec -it <container id> bash

This command is used to access the running container

<img src=”” alt=”docker_psa – Docker Commands – Edureka” />7. Docker stop

Usage: docker stop

<container id>

This command stops a running container

<img src=”” alt=”docker_exec – Docker Commands – Edureka” />8. Kill Docker

Usage: docker kill <container id>

This command kills the container by stopping its execution immediately. The difference between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’ gives the container time to shut down properly, in situations where it takes too long to stop the container, you can choose to kill it

docker_stop - Docker Commands - Edureka9. Docker Confirmation

Usage: docker commit <conatainer id> <username/imagename>

This command creates a new image of an edited container on the local system

<img src=”” alt=”docker_kill – Docker Commands – Edureka” />10. Docker login

This command is used to log in to the docker hub<

img repository src=”” alt=”docker_commit – Docker Commands – Edureka” />11.

docker push Usage: docker push

<username/image name>

This command is used to push an image to the

docker hub repository

<img src=”” alt=”docker_login – Docker – Edureka commands” />12. Docker


This command lists all

locally stored Docker images <img src=”” alt=”docker_ push – Docker Commands – Edureka” />13. Using Docker RM:

docker rm <container id


This command is used to delete a stopped container

<img src=”” alt=”docker_images – Docker Commands – Edureka” />14. Docker RMI

Usage: docker rmi <image-id


This command is used to delete an image from local storage

<img src=”” alt=”docker_rm – Docker Commands – Edureka” />15. Building Docker


docker build <path to docker file>

This command is used to construct an image from a

specified docker file

<img src=”” alt=”docker_rmi – Docker Commands – Edureka” />

Want to learn more about docker commands? Here’s a Docker tutorial to get you started. Alternatively, you can take a top-down approach and get started with this Devops tutorial.

Now that you’ve understood what DevOps is, check out our DevOps certification training from Edureka, a trusted online learning company with a network of over 250,000 satisfied learners spread across the globe. The Edureka DevOps certification training course helps students gain experience in various DevOps processes and tools such as Puppet, Jenkins, Nagios, Ansible, Chef, Saltstack, and GIT to automate multiple steps in SDLC.

Do you have a question for us? Please mention it in the comments section and we will contact you.

Contact US