Today marks the beginning of my DevOps learning journey, and I kicked it off by diving into Docker. Here's what I learned and accomplished on my first day.
no more it works on my machine 🚀
Understanding the Basics
First, I grasped the fundamental concepts:
- Containers: Lightweight, standalone packages that include everything needed to run a piece of software, ensuring consistency across different environments.
- Docker: A platform that enables creating, deploying, and running applications using container technology.
- Docker Hub: The official repository for Docker images, like GitHub but for container images.
Essential Docker Commands
I learned several basic Docker commands that are crucial for container management:
# List all running containers
docker ps
# List all Docker images on your system
docker image ls
# Pull an image from Docker Hub
docker pull [image-name]
# Remove containers or images
docker remove [container-id/name]
# Run a container
docker run [options] [image-name]
Hands-on Practice: Running Nginx
My first practical exercise was setting up an Nginx web server using Docker. Here's how I did it:
docker run --name my-nginx -p 8080:80 -d nginx
Let's break down this command:
-
--name my-nginx
: Assigns a custom name to the container -
-p 8080:80
: Maps port 8080 on my host to port 80 in the container -
-d
: Runs the container in detached mode (background) -
nginx
: The image to use
Connecting to Docker Playground
One interesting challenge I tackled was accessing Docker Playground from Windows using Git Bash via SSH. This gave me experience with:
- Remote container management
- Using SSH for Docker connections
- Working with Docker in a cloud environment
Key Takeaways from Day 1
- Docker simplifies application deployment through containerization
- Basic Docker commands are intuitive and follow a logical pattern
- Port mapping is crucial for accessing containerized applications
- Docker Playground provides a great environment for learning
What's Next?
Tomorrow, I plan to explore:
- Create own docker image using as Dockerfile.
- Deploying own simple express app.
- Multi-container applications.
- Docker networking basics.
the resource I used for learning docker is : https://youtu.be/rr9cI4u1_88?si=s8ehmucFYWfjcci5
Stay tuned for more updates on my DevOps journey! Feel free to share your thoughts and suggestions in the comments below.
Top comments (0)