AWS Builder Center

Getting Started with Docker: My First Step into DevOps

A beginner-friendly guide to Docker covering images, containers, Dockerfiles, and Docker Compose with practical examples and lessons from my learning journey.

Body

Introduction

When I started learning DevOps, one of the first technologies everyone recommended was Docker. At first, I thought Docker was just another virtualization tool, but I soon learned that containers solve a very different problem.
In this article, I'll explain the Docker concepts I learned as a beginner, along with practical examples.



What is Docker?

Docker is an open-source platform that packages applications and all their dependencies into lightweight containers.
This means an application behaves the same whether it runs on:
  • My laptop
  • A testing server
  • A production server
  • AWS EC2
Instead of saying:
"It works on my machine."
Docker lets us confidently say:
"It works everywhere."



Why Docker?

Before Docker, developers often faced problems like:
  • Different software versions
  • Missing dependencies
  • Configuration issues
  • Environment inconsistencies
Docker solves these by packaging everything together.
Benefits include:
  • Faster deployments
  • Consistent environments
  • Lightweight compared to virtual machines
  • Easy scalability
  • Better collaboration between developers and operations teams



Docker Architecture

Docker consists of:
  • Docker Client
  • Docker Daemon
  • Docker Images
  • Docker Containers
  • Docker Registry (Docker Hub or Amazon ECR)
The client sends commands.
The daemon builds and runs containers.



Image vs Container

A Docker Image is a blueprint.
A Docker Container is a running instance of that blueprint.
Think of it like this:
  • Image = Recipe
  • Container = Cooked meal
One image can create many containers.



My First Docker Container

The first command I executed was:
docker run hello-world
This command:
  • Downloads the image
  • Creates a container
  • Runs it
  • Prints a success message
It was the first time I saw containerization in action.



Dockerfile

A Dockerfile automates image creation.
Example:
FROM python:3.12

WORKDIR /app

COPY . .

RUN pip install -r requirements.txt

CMD ["python","app.py"]
This tells Docker:
  • Which base image to use
  • Where to store files
  • Which dependencies to install
  • How to start the application



Docker Compose

Docker Compose helps manage multiple containers.
For example:
  • Django
  • MySQL
  • Nginx
can all start using a single command.
docker compose up
Instead of starting each container separately, Compose handles everything together.



Real Project

One of the projects I built was a Dockerized Django Notes application.
It included:
  • Django
  • MySQL
  • Nginx
  • Docker Compose
This project helped me understand:
  • Multi-container architecture
  • Networking
  • Volumes
  • Environment variables
  • Container communication



Key Takeaways

While learning Docker, I realized it is much more than just running containers.
It teaches:
  • Consistent deployments
  • Infrastructure automation
  • Cloud-native development
  • DevOps best practices
Docker has become one of the most important skills in my DevOps journey.



Conclusion

If you're beginning DevOps, Docker is one of the best technologies to learn first. Mastering containers makes it much easier to understand Kubernetes, CI/CD pipelines, and cloud deployments later.
I'm continuing to explore AWS, Kubernetes, Terraform, Jenkins, and other DevOps tools, and I'll share more of my learning through future articles.
Thanks for reading!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article