All Docker Commands

docker –version: Check the Docker version.

docker help: Display help information for Docker.

Working with Images:

docker pull: Pull an image from a registry.
docker pull <image-name>

docker images: List all images on the local syst…


This content originally appeared on DEV Community and was authored by Sujith V S

docker --version: Check the Docker version.

docker help: Display help information for Docker.

Working with Images:

docker pull: Pull an image from a registry.
docker pull <image-name>

docker images: List all images on the local system.

docker build: Build an image from a Dockerfile.
docker build -t <image-name> .

docker rmi: Remove one or more images.
docker rmi <image-name>

docker tag: Tag an image with a new name.
docker tag <source-image> <target-image>

Working with Containers:

docker run: Run a command in a new container.
docker run -it <image-name>

docker ps: List all running containers.
docker ps

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

docker start: Start one or more stopped containers.
docker start <container-id>

docker stop: Stop one or more running containers.
docker stop <container-id>

docker restart: Restart a container.
docker restart <container-id>

docker rm: Remove one or more containers.
docker rm <container-id>

docker logs: Fetch the logs of a container.
docker logs <container-id>

docker exec: Run a command in a running container.
docker exec -it <container-id> <command>

Networking:

docker network ls: List all networks.
docker network ls

docker network create: Create a new network.
docker network create <network-name>

docker network inspect: Display detailed information on one or more networks.
docker network inspect <network-name>

docker network rm: Remove one or more networks.
docker network rm <network-name>

Volumes:

docker volume ls: List all volumes.
docker volume ls

docker volume create: Create a new volume.
docker volume create <volume-name>

docker volume inspect: Display detailed information on one or more volumes.
docker volume inspect <volume-name>

docker volume rm: Remove one or more volumes.
docker volume rm <volume-name>

Docker Compose:

docker-compose up: Build, create, start, and attach to containers.
docker-compose up

docker-compose down: Stop and remove containers, networks, images, and volumes.
docker-compose down

docker-compose build: Build or rebuild services.
docker-compose build

docker-compose ps: List containers.
docker-compose ps

docker-compose exec: Execute a command in a running container.
docker-compose exec <service-name> <command>

Docker System Management:

docker system df: Show docker disk usage.
docker system df

docker system prune: Remove unused data.
docker system prune


This content originally appeared on DEV Community and was authored by Sujith V S


Print Share Comment Cite Upload Translate Updates
APA

Sujith V S | Sciencx (2025-02-25T05:12:30+00:00) All Docker Commands. Retrieved from https://www.scien.cx/2025/02/25/all-docker-commands/

MLA
" » All Docker Commands." Sujith V S | Sciencx - Tuesday February 25, 2025, https://www.scien.cx/2025/02/25/all-docker-commands/
HARVARD
Sujith V S | Sciencx Tuesday February 25, 2025 » All Docker Commands., viewed ,<https://www.scien.cx/2025/02/25/all-docker-commands/>
VANCOUVER
Sujith V S | Sciencx - » All Docker Commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/02/25/all-docker-commands/
CHICAGO
" » All Docker Commands." Sujith V S | Sciencx - Accessed . https://www.scien.cx/2025/02/25/all-docker-commands/
IEEE
" » All Docker Commands." Sujith V S | Sciencx [Online]. Available: https://www.scien.cx/2025/02/25/all-docker-commands/. [Accessed: ]
rf:citation
» All Docker Commands | Sujith V S | Sciencx | https://www.scien.cx/2025/02/25/all-docker-commands/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.