Docker Cheat Sheet

Docker Cheat Sheet

Docker is a powerful tool for containerization that enables developers to package applications along with their dependencies into a standardized unit called a container. Whether you're just starting with Docker or need a quick reference, this cheat sheet covers essential Docker commands and concepts to help you navigate through your containerization journey.


Article content


Article content

Here's a detailed Docker cheat sheet for your reference:

docker --version - Show Docker version.

docker run [OPTIONS] IMAGE [COMMAND]- Run a command in a new container.

docker ps -List running containers.

docker ps -a - List all containers, including stopped ones.

docker images - List all Docker images.

docker pull IMAGE - Pull an image from a registry.

docker build -t NAME:TAG - Build an image from a Dockerfile.

docker push NAME:TAG - Push an image to a registry.

docker exec -it CONTAINER COMMAND - Execute a command in a running container.

docker stop CONTAINER - Stop a running container.

docker start CONTAINER - Start a stopped container.

docker restart CONTAINER - Restart a running container.

docker rm CONTAINER - Remove a stopped container.

docker rm IMAGE - Remove an image.

docker logs CONTAINER - View logs of a container.

docker inspect CONTAINER - Display detailed information about a container or image.

docker commit CONTAINER NEW_IMAGE - Create a new image from a container's changes.

docker tag IMAGE NEW_TAG - Tag an image with a new name.

docker network ls - List all Docker networks.

docker network create NETWORK- Create a new network.

docker network connect NETWORK CONTAINER- Connect a container to a network.

docker volume ls - List all Docker volumes.

docker volume create VOLUME - Create a new volume.

docker volume rm VOLUME - Remove a volume.

docker-compose up -d - Start all services defined in a docker-compose.yml file in detached mode.

docker-compose down - Stop and remove containers, networks, images, and volumes defined in a docker-compose.yml file.

docker-compose logs - View logs of services defined in a docker-compose.yml file.

docker-compose psList containers in a docker-compose.yml file.


Docker is an indispensable tool for modern DevOps practices, enabling the creation, deployment, and management of applications in a streamlined and consistent manner. Mastering these Docker commands will significantly enhance your ability to manage containerized applications efficiently.


To view or add a comment, sign in

More articles by Riya Negi

  • Kubernetes Overview

    What is Kubernetes and Why Do We Call It K8s? Kubernetes (often abbreviated as K8s) is an open-source platform for…

    1 Comment
  • Jenkins Important Interview Questions

    Important Interview Questions. Jenkins is a cornerstone of modern CI/CD pipelines, and mastering it can give you a…

  • Mastering Jenkins Agents!

    The Jenkins Master, often referred to as the Jenkins Server, is the core component in a Jenkins architecture. It…

  • Jenkins Declarative Pipeline with Docker

    Hello Connections, So we will start with Jenkin Declarative pipeline with Docker. Before that we should know why to…

    2 Comments
  • Jenkins Declarative Pipeline

    So, Lets go deep into Jenkins and learn to start Pipeline in Jenkins. First let basics of Pipeline and all stuffs.

  • Complete Jenkins CI/CD Project

    Let Set Up the Jenkins CI/CD Project For this follow these step carefully and here we begins Step 1: Fork the…

  • Jenkins Freestyle Project for DevOps Engineers.

    What is CI/CD? CI/CD stands for Continuous Integration (CI) and Continuous Deployment (CD) (or Continuous Delivery). It…

  • Getting Started with Jenkins

    What is Jenkins? Jenkins is an open-source continuous integration (CI) and continuous delivery/deployment (CD)…

  • Docker Important interview Questions.

    1. What is the difference between an Image, Container, and Engine? Image: An image is a lightweight, stand-alone…

  • Docker Project for DevOps Engineers

    Lets build the first ngnix container and see it is working or not? So we will give command as -docker run -d -p 80:80…

Insights from the community

Others also viewed

Explore topics