Docker Decoded: Your All-in-One Guide to Container Magic ππ³Day - 20
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! ππ³
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! π