This is #90DaysofDevops challenge under the guidance of Shubham Londhe sir.
Introduction
Welcome to Day 16 of your DevOps journey! Today, we're going to explore Docker, a fantastic tool that makes deploying and managing applications a breeze.
What's Docker Magic?
Docker is like a superhero for developers and operations folks. It lets you package your applications along with all the things they need to run, like libraries and tools, into something called a container. These containers are like mini-computers that you can run on any computer, server, or even in the cloud.
Why You'll Love Docker:
Easy Setup: Docker makes setting up your application environments quick and painless.
Consistency: With Docker, you can be sure your app will run the same way on your computer as it does in production.
Let's Dive into Docker Commands:
docker run
: Getting StartedThis command is your go-to for starting a new container.
Example:
docker run -d -p 8000:8000 nginx:latest
It's like saying, "Hey Docker, I want to run this 'nginx' thing."
docker inspect
: A Closer LookThis command lets you peek inside a container or image to see what's going on.
Example:
docker inspect <container_or_image_id>
Use it to find out more about your containers and images.
docker port
: Checking PortsSometimes you need to know which ports are open on a container. This command helps with that.
Example:
docker port <container_id>
It tells you which ports of the container are connected to your computer.
docker stats
: Keeping an Eye on ResourcesWant to know how much CPU and memory your containers are using? This command has you covered.
Example:
docker stats <container1> <container2>
Keep track of your containers' resource usage with ease.
docker top
: Peeking InsideThis command lets you see what's happening inside a container.
Example:
docker top <container_id>
Check out the processes running in your container.
docker save
anddocker load
: Saving and LoadingSometimes you want to save your Docker images to a file or load them back. These commands help you do just that.
Examples:
Save:
docker save -o <output_file.tar> <image_name>
Load:
docker load -i <input_file.tar>
With these commands, you'll be well on your way to becoming a Docker pro. Happy exploring!