Day 20 : Docker Cheatsheet

Day 20 : Docker Cheatsheet

Cheatsheet for frequently used Docker Commands

ยท

2 min read

CommandDescription
docker pull [IMAGE_NAME]:[TAG]Pull an image from a registry.
docker imagesList all locally available Docker images.
docker run [OPTIONS] [IMAGE_NAME] [CMD]Run a Docker container from an image.
docker psList all running containers.
docker ps -aList all containers (running and stopped).
docker stop [CONTAINER_ID]Stop a running container.
docker rm [CONTAINER_ID]Remove a stopped container.
docker rm $(docker ps -a -q)Remove all stopped containers.
docker rmi [IMAGE_ID]Remove a Docker image.
docker rmi $(docker images -q)Remove all Docker images.
docker-compose upCreate and start containers defined in docker-compose.yml.
docker-compose up -dCreate and start containers in detached mode.
docker-compose downStop and remove containers defined in docker-compose.yml.
docker-compose psList all containers defined in docker-compose.yml.
docker-compose logs [SERVICE]View logs of a specific service.
docker-compose exec [SERVICE] [COMMAND]Execute a command inside a running service container.
docker volume lsList all Docker volumes.
docker volume create [VOLUME_NAME]Create a Docker volume.
docker volume inspect [VOLUME_NAME]Display detailed information about a Docker volume.
docker volume rm [VOLUME_NAME]Remove a Docker volume.
docker volume pruneRemove all unused Docker volumes.
docker network lsList all Docker networks.
docker network create [NETWORK_NAME]Create a Docker network.
docker network inspect [NETWORK_NAME]Display detailed information about a Docker network.
docker network connect [NET_NAME] [CONTAINER_ID]Connect a container to a Docker network.
docker network disconnect [NET_NAME] [CONTAINER_ID]Disconnect a container from a Docker network.

โœ‰Endcard:

๐ŸŽ‰ Thank you for joining me on this insightful journey into the world of DevOps!

โค If you found this blog helpful and informative, don't forget to give it a like!

๐Ÿ”„ Share this valuable knowledge with your friends and colleagues, so they can also benefit from understanding the power of DevOps!

๐Ÿ‘‰ Stay updated with my latest posts and never miss out on exciting content! Click that Follow button to join and stay in the loop!

Follow me on LinkedIn -->abdallah-qamar๐Ÿ‘”

Stay tuned for Day 21...๐Ÿ‘‹

ย