Docker Commands Tutorial - Top 15 Docker Commands

Docker Commands Tutorial - Top 15 Docker Commands

In this article, I will talk about the Top 15 Docker Commands that you will be using frequently while you are working with Docker

Originally published at https://www.edureka.co

Following are the commands which are 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
  • docker images
  • docker rm
  • docker rmi
  • docker build

So, let’s get started:

Docker Commands

1. docker –version

This command is used to get the currently installed version of docker

2. docker pull

Usage: docker pull <image name>

This command is used to pull images from the docker repository(hub.docker.com)

3. docker run

Usage: docker run -it -d <image name>

This command is used to create a container from an image

4. docker ps

This command is used to list the running containers

5. docker ps -a

This command is used to show all the running and exited containers

6. docker exec

Usage: docker exec -it <container id> bash

This command is used to access the running container

7. docker stop

Usage: docker stop <container id>

This command stops a running container

8. docker kill

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 shutdown gracefully, in situations when it is taking too much time for getting the container to stop, one can opt to kill it

9. docker commit

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

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

10. docker login

This command is used to login to the docker hub repository

11. docker push

Usage: docker push <username/image name>

This command is used to push an image to the docker hub repository

12. docker images

This command lists all the locally stored docker images

13. docker rm

Usage: docker rm <container id>

This command is used to delete a stopped container

14. docker rmi

Usage: docker rmi <image-id>

This command is used to delete an image from local storage

15. docker build

Usage: docker build <path to docker file>

This command is used to build an image from a specified docker file

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow me on Facebook | Twitter

Further reading

Docker for Absolute Beginners

Tutorial Laravel 6 with Docker and Docker-Compose

Docker Tutorial From Beginner to Advanced

Docker Containers for Beginners

Build Docker Images and Host a Docker Image Repository with GitLab



docker devops kubernetes

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

DevOps Tutorial - Docker, Kubernetes, and Azure DevOps

In this article, we break down everything you need to know about DevOps, so that you can get started building your own CI/CD pipeline. DevOps Tutorial - Docker, Kubernetes, and Azure DevOps

Kubernetes vs Docker

Get Hands-on experience on Kubernetes and the best comparison of Kubernetes over the DevOps at your place at Kubernetes training

Docker vs. Kubernetes | Docker vs. Kubernetes Difference

Docker and Kubernetes are two orchestration tools that very popular. Many people have trouble picking one. In this video on Docker vs Kubernetes, we will be comparing these two tools end to end and see which one will suit your needs better.

DevOps and Docker Live Show (Ep 91)

Join me with guest Docker Captain Elton Stoneman to talk about the state of Docker Desktop and Docker Hub. Support this show on Patreon! It's the #1 way to support me interviewing DevOps and container experts, and doing this Live Q&A.

Docker manifest - A peek into image's manifest.json files

The docker manifest command does not work independently to perform any action. In order to work with the docker manifest or manifest list, we use sub-commands along with it. This manifest sub-command can enable us to interact with the image manifests. Furthermore, it also gives information about the OS and the architecture, that a particular image was built for. The image manifest provides a configuration and a set of layers for a container image. This is an experimenta