Docker Decoded: Your All-in-One Guide to Container Magic πŸš€πŸ³Day - 20

Vishal ShekokarVishal Shekokar
2 min read

Hello, Amazing Hash Node Community! 🌟 Today, we're embarking on a delightful journey into the fascinating world of Docker. Whether you're a seasoned tech wizard or someone taking the first steps into the realm of containers, this comprehensive Docker guide is your passport to the magical land of computer sorcery. Buckle up as we unveil a single, enchanting Docker Cheat Sheetβ€”a treasure trove of commands that will empower your journey into the heart of container magic!

Unraveling the Docker Commands πŸ—ΊοΈ

Let's dive into the magical commands that bring your Docker adventure to life:

# 1. Brewing Potions (Building Images): 🏰
docker build -t image_name:tag .

# 2. Sending Potions on a Journey (Running Containers): 🚒
docker run -d -p host_port:container_port --name container_name image_name:tag

# 3. Checking Your Potion Collection (List Running Containers): πŸ“Š
docker ps

# 4. Discovering Potion Ingredients (Inspecting Containers): πŸ”
docker inspect container_name

# 5. Taking a Break from Magic (Stop a Container): ⏸️
docker stop container_name

# 6. Saying Farewell to Potions (Remove a Container): 🎈
docker rm container_name

# 7. Checking the Potion Cabinet (List All Containers): 🧳
docker ps -a

# 8. Visiting the Potion Gallery (List Images): πŸ–ΌοΈ
docker images

# 9. Magic Eraser (Remove an Image): πŸš€
docker rmi image_name:tag

# 10. Joining the Magical Show with Docker-Compose 🎢

# 11. Gathering the Magical Ensemble (Run Containers with Docker-Compose): 🎭
docker-compose up -d

# 12. Bringing Peace to the Magical Show (Stop Containers with Docker-Compose): 🀫
docker-compose down

# 13. Melody of Logs (View Logs with Docker-Compose): 🎻
docker-compose logs

# 14. Architect's Redesign (Rebuild Containers with Docker-Compose): πŸ—οΈ
docker-compose build

# 15. Growing the Magical Ensemble (Scale Services with Docker-Compose): πŸ“ˆ
docker-compose up -d --scale service_name=num_instances

# 16. Taking Command of the Magical Orchestra (Execute Commands in a Service): πŸ› οΈ
docker-compose exec service_name command

# 17. Freezing Time in the Magical World (Pause/Unpause Services): ⏸️/▢️
docker-compose pause
docker-compose unpause

Feel the magic in every command as you navigate through your Docker adventure. Each line is a spell that conjures containers, orchestrates services, and brings your coding dreams to life. Copy and paste this spellbook into your terminal, and may your Docker journey be filled with enchantment! πŸš€πŸ³

0
Subscribe to my newsletter

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

Written by

Vishal Shekokar
Vishal Shekokar

πŸ‘‹ Hello, I'm Vishal, an aspiring Information Technology enthusiast currently embarking on a journey towards a Bachelor's degree in Engineering. My passion lies in exploring the dynamic realms of cloud computing and DevOps technologies, where I constantly strive to bridge the gap between innovation and practical implementation. πŸ’‘ As a student of Information Technology, I'm on a mission to absorb knowledge, solve real-world problems, and contribute to the tech community. My academic pursuits fuel my curiosity, and my hands-on experience with cloud and DevOps tools empowers me to navigate the evolving landscape of modern technology. πŸš€ Join me as I share insights, discoveries, and challenges encountered on this exciting educational and professional adventure. Let's connect, collaborate, and grow together in the ever-expanding world of IT. πŸ”— Connect with me on social media and let's build a network that fosters learning, sharing, and innovation. Happy coding! 🌟