Day 20: Docker Cheatsheet
Have you ever found yourself swimming in a sea of Docker commands, desperately searching for the right incantation to make your containers dance to your tune? ๐ณ๐
Look no further! In this comprehensive Docker cheatsheet, I'll equip you with the knowledge and shortcuts you need to sail smoothly through your Docker journey. โ๐ข
Docker Cheat Sheet ๐
1. Docker Basics ๐ณ
docker --version
: Check Docker version.docker info
: Display system-wide information.docker run image_name
: Create and start a container.docker stop container_name
: Stop a running container.docker rm container_name
: Remove a container.docker ps
: List running containers.docker images
: List local images.docker pull image_name
: Pull an image from a registry.docker rmi image_name
: Remove an image.docker logs container_name
: View container logs.
2. Docker Compose ๐ค
docker-compose --version
: Check Docker Compose version.docker-compose up
: Start containers defined indocker-compose.yml
.docker-compose down
: Stop and remove containers.docker-compose ps
: List running services.docker-compose logs service_name
: View service logs.docker-compose exec service_name command
: Run a command in a service.docker-compose build
: Build services.docker-compose pull
: Pull service images.docker-compose restart service_name
: Restart a service.docker-compose down -v
: Remove containers and volumes.
3. Advanced Docker ๐
Docker Networking: Explore bridge, host, and custom networks.
Docker Volumes: Manage data volumes for persistent storage.
Dockerfile: Create custom Docker images.
Docker Swarm: Orchestrate multi-container applications.
Docker Hub: Publish and share your Docker images.
Conclusion ๐
Creating a Docker cheat sheet is a fantastic way to solidify your knowledge, have a handy reference, and contribute to the DevOps community. So, start crafting your ultimate Docker cheat sheet today and become a Docker maestro! ๐ณ๐
Happy Dockering! ๐ข๐ฅ
Subscribe to my newsletter
Read articles from Gunjan Bhadade directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by