Skip to main content

Command Palette

Search for a command to run...

Day 20 Task : Docker commands Cheat-Sheet

Published
2 min read
Day 20 Task : Docker commands Cheat-Sheet

Docker overview:

Docker is a set of PaaS that delivers applications in the form of a container. The software that hosts the containers is called docker enginer.

Docker is a tool that is used to automate the deployment of applications in lightweight containers so that applications can work efficiently in different environments in isolation.

Docker can package an application and its dependencies in a virtual container that can run on any Linux, Windows, or macOS computer.

Docker CLI Cheatsheet (Basic and Advanced):

Command

Description

docker version

Show Docker version info

docker info

Display Docker system-wide information

docker pull <image>

Download an image from Docker Hub

docker images

List all locally available images

docker ps

List running containers

docker ps -a

List all containers, including stopped ones

docker run <image>

Create and start a container from an image

docker start <container>

Start a stopped container

docker stop <container>

Stop a running container

docker restart <container>

Restart a container

docker rm <container>

Remove a stopped container

docker rmi <image>

Remove an image

docker exec -it <container> <command>

Execute a command inside a running container

docker build -t <image_name> <dockerfile_path>

Build an image from a Dockerfile

docker-compose up

Create and start containers defined in the docker-compose.yml

docker-compose down

Stop and remove containers, networks, and volumes defined in the docker-compose.yml