DEV Community

Prajwal M
Prajwal M

Posted on

Docker Basics: What I Wish I knew as a Beginner

Docker can feel overwhelming at first. Here's a simple breakdown of the core concepts I learned as a software intern working with cloud infrastructure.

What is Docker?

Docker is a tool that packages your application and everything it needs (libraries, dependencies, config) into a single unit called a container.

Think of it like a lunchbox — everything your app needs to run is packed inside, so it works the same everywhere.

Key Concepts

  1. Image
    A blueprint/template. It defines what goes inside the container.

  2. Container
    A running instance of an image. Like an object created from a class.

  3. Dockerfile
    A text file with instructions to build an image.

Example:
dockerfile
FROM python:3.9
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "app.py"]

  1. Docker Hub A public registry where you can find and share images. Like GitHub but for Docker images.

Basic Commands

| Command | What it does |
| docker pull nginx | Download an image |
| docker run nginx | Run a container |
| docker ps | List running containers |
| docker stop <id> | Stop a container |
| docker images | List downloaded images |

When to Use Docker?

  • "It works on my machine" problems — Docker fixes this
  • Running multiple apps with different dependencies
  • Quick setup of databases, servers for testing
  • Deploying apps consistently across environments

Conclusion

Docker simplifies how we build, ship, and run applications. Start with these basics, practice with small projects, and it'll click quickly.

I'm a software intern at Ericsson R&D working on cloud-native infrastructure. Follow me for more simplified tech content.

Top comments (0)