Day 20: Docker Cheatsheet

Gunjan BhadadeGunjan Bhadade
2 min read

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 in docker-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! ๐Ÿšข๐Ÿ”ฅ

0
Subscribe to my newsletter

Read articles from Gunjan Bhadade directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Gunjan Bhadade
Gunjan Bhadade