KEMBAR78
Docker Command Cheat Sheet | PDF
0% found this document useful (0 votes)
37 views2 pages

Docker Command Cheat Sheet

Uploaded by

sk8578423
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Docker Command Cheat Sheet

Uploaded by

sk8578423
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Docker Command Cheat Sheet

Docker Images
- List all images: docker images

- Pull an image: docker pull <image_name>:<tag>

- Remove an image: docker rmi <image_id_or_name>

- Build an image: docker build -t <image_name>:<tag> <path>

- Tag an image: docker tag <image_name>:<tag> <new_name>:<new_tag>

Docker Containers
- List running containers: docker ps

- List all containers: docker ps -a

- Start a container: docker start <container_id_or_name>

- Stop a container: docker stop <container_id_or_name>

- Remove a container: docker rm <container_id_or_name>

- Run a command inside a container: docker exec -it <container_id_or_name> <command>

Docker Volumes
- List volumes: docker volume ls

- Create a volume: docker volume create <volume_name>

- Remove a volume: docker volume rm <volume_name>

Docker Networks
- List networks: docker network ls

- Create a network: docker network create <network_name>

- Connect a container to a network: docker network connect <network_name>

<container_name_or_id>

Docker Compose
- Start services: docker-compose up

- Start services in detached mode: docker-compose up -d

- Stop services: docker-compose down

Docker Cleanup
- Remove unused images: docker image prune

- Remove all unused containers, networks, and images: docker system prune

You might also like