← Back to list

Docker Basics: Images, Containers, and Registries

Introduction

Saket Sisodia · 2026-06-03 08:27 · 0 claps · 2.2 min read
#docker-image #docker #containers #docker-container
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

Docker Basics: Images, Containers, and Registries

Introduction

In today’s software world, speed and consistency are everything. Developers want their applications to run the same way on laptops, servers, or in the cloud. That’s where Docker comes in. Docker is a platform that packages applications into containers, making them portable, efficient, and reliable.

But before diving into advanced topics like orchestration or scaling, it’s crucial to understand three foundational concepts: images, containers, and registries. These are the building blocks of Docker, and mastering them will set you up for success in modern DevOps and cloud-native development.

Docker Images

A Docker image is essentially a blueprint. It contains everything your application needs to run: code, libraries, dependencies, and even environment variables.

  • How they’re built: Images are created using a Dockerfile, which is a script with instructions like FROM ubuntu:20.04, RUN apt-get install, or COPY . /app.
  • Layered architecture: Each instruction in a Dockerfile creates a new layer. This makes images efficient because unchanged layers can be reused across builds.
  • Versioning: Images can be tagged (e.g., myapp:v1.0) so you can roll back or deploy specific versions.

Example: If you’re building a Python web app, your image might start with python:3.9 as the base, then add your app code and dependencies.

Docker Containers

A container is a running instance of an image. If the image is the recipe, the container is the actual dish prepared from it.

  • Isolation: Containers run in their own environment but share the host OS kernel. This makes them lightweight compared to virtual machines.
  • Lifecycle: You can start, stop, restart, and remove containers with simple commands like docker run, docker stop, or docker rm.
  • Networking: Containers can communicate with each other using Docker networks, making them perfect for microservices.

Example: Running docker run -p 8080:80 nginx starts a container from the Nginx image, mapping port 80 inside the container to port 8080 on your machine.

Docker Registries

A registry is where images live. It’s like GitHub, but for Docker images.

  • Public registries: Docker Hub is the most popular. You can pull images like docker pull mysql directly from it.
  • Private registries: Enterprises often use AWS ECR, Azure Container Registry, or Google Artifact Registry to store proprietary images securely.
  • CI/CD integration: Registries are critical in automated pipelines. Developers push new images after a build, and deployment systems pull them to update applications.

Example: Your team might push a new version of your app image to a private registry, and Kubernetes will automatically pull it to update pods.

Why These Concepts Matter

Understanding images, containers, and registries helps you:

  • Achieve consistency: The same image runs identically on your laptop, staging, and production.
  • Speed up deployments: Containers start in seconds, unlike VMs that take minutes.
  • Scale easily: With orchestration tools like Kubernetes, you can run hundreds of containers across clusters.
  • Collaborate better: Teams can share images via registries, ensuring everyone works with the same environment.

Common Pitfalls and Best Practices

  • Don’t bloat images: Use slim base images (python:3.9-slim) to reduce size.
  • Tag properly: Avoid using latest in production; always tag with versions.
  • Secure registries: Use authentication and role-based access for private registries.
  • Clean up containers: Remove unused containers and images to save disk space.

메타데이터
post_id
bee66fd8dee4
slug
docker-basics-images-containers-and-registries-bee66fd8dee4
url
https://medium.com/@saketsis/docker-basics-images-containers-and-registries-bee66fd8dee4
canonical_url
https://medium.com/@saketsis/docker-basics-images-containers-and-registries-bee66fd8dee4
author_url
https://medium.com/@saketsis
status
ok
fetched_at
2026-06-27 18:20:27