🐳 Day 20 - Docker Cheat Sheet

Docker is like a super tool that helps developers put their apps in containers. It's great for everyone, whether you're just starting out or want to get better at Docker. This cheat sheet will help you with installing Docker, managing volumes (like extra storage for your containers), handling images (like app blueprints), and doing things with containers (like starting, stopping, and removing them).

📀Image Management:

CommandDescription
docker imagesList all images.
docker pull [image_name]Download an image.
docker rmi [image_id]Remove an image.
docker build -t [image_name] [dockerfile_path]Build an image from a Dockerfile.

📀Docker Container:

docker psList running containers.
docker ps -aList all containers.
docker run [options] [image_name]Create and start a container.
docker start [container_id]Start a stopped container.
docker stop [container_id]Stop a running container.
docker rm [container_id]Remove a container.
docker exec [options] [container_id] [command]Run a command in a running container.
docker cp [source_path] [container_id]:[destination_path]Copy files between a container and the local filesystem.
docker logs [container_id]Fetch the logs of a container.

📀Docker Volume:

docker volume lsList volumes.
docker volume create [options] [volume_name]Create a volume.
docker volume inspect [volume_name]Inspect a volume.
docker volume rm [volume_name]Remove a volume.

📀Docker Networking:

docker network lsList networks.
docker network inspect [network_id]Inspect a network.
docker network create [options] [network_name]Create a network.
docker network connect [network_id] [container_id]Connect a container to a network.
docker network disconnect [network_id] [container_id]Disconnect a container from a network.

📀Docker Compose:

docker-compose [options] [command] [services]Manage multi-container Docker applications.
Options:
--file [docker-compose.yml]: Specify an alternate compose file.
--project-name [project_name]: Specify an alternate project name.
Commands:
up: Create and start containers.
down: Stop and remove containers, networks, and volumes.
build: Build or rebuild services.
start: Start services.
stop: Stop services.

With this cheat sheet in hand, you're all set to navigate Docker like a pro! Share this valuable resource with the DevOps community to spread the knowledge. Keep learning and exploring, as Docker has a lot to offer. Here's to happy containerizing and seamless deployment!🚀🐳🌐

💠I hope this blog sounds like it will be a valuable resource, offering fresh perspectives and introducing exciting new ideas. I'm sure it will be a great addition to the DevOps community.

Happy learning and blogging!😊

22
Subscribe to my newsletter

Read articles from Pratik R. Mandge directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratik R. Mandge
Pratik R. Mandge

Hey there! 👋 I'm Pratik R. Mandge, a DevOps Engineer passionate about all things AWS DevOps Technology. Currently on a learning adventure, I'm here to share my journey and Blog's in the world of cloud and DevOps. 🛠️ My focus? Making sense of AWS services, improving CI/CD, and diving into infrastructure as code. Whether you're fellow interns or curious enthusiasts, let's grow together in the vibrant DevOps space. 🌐 Connect with me for friendly chats, shared experiences, and learning moments. Here's to embracing the learning curve and thriving in the exciting world of AWS DevOps Technology! Follow me on LinkedIn: https://www.linkedin.com/in/pratik-mandge363