Skip to Content

Containers

What Docker containers are, how they differ from virtual machines, how images are built and stored, and the AWS container services in this group.

What it is

Docker is a software platform for deploying applications. Each app is packaged in a container: the app plus everything it needs (libraries, runtime, settings), so it runs the same everywhere:

  • on any machine;
  • with no compatibility issues;
  • with predictable behaviour;
  • with less work, and easier maintenance and deployment;
  • with any language, any OS, any technology.

Use cases: microservices architectures, and lift-and-shift of apps from on premises to AWS. One server (for example an EC2 instance) can run many containers at once: a Java app, a Node.js app and a MySQL database side by side.

Containers vs virtual machines

Virtual machines versus containers: each virtual machine runs its own guest operating system on a hypervisor, so a host fits few of them; containers share the host operating system through the Docker daemon, so many containers fit on one host Virtual machines versus containers: each virtual machine runs its own guest operating system on a hypervisor, so a host fits few of them; containers share the host operating system through the Docker daemon, so many containers fit on one host

VMs each carry an OS; containers share one.

Docker is sort of a virtualization technology, but not exactly:

  • A virtual machine has its own full guest operating system, running on a hypervisor.
  • Containers share the host's operating system through the Docker daemon. They're much lighter, so many containers fit on one server and they start in seconds.

From code to running container

From code to container: a Dockerfile is built into an image holding the app and its dependencies; the image is pushed to a registry such as Amazon ECR or Docker Hub; a host pulls it and runs it as a container From code to container: a Dockerfile is built into an image holding the app and its dependencies; the image is pushed to a registry such as Amazon ECR or Docker Hub; a host pulls it and runs it as a container

Build an image, store it, run it anywhere.
  1. A Dockerfile describes how to build the image (for example: start from Ubuntu, copy the app, install it, set the start command).
  2. Build it into an image.
  3. Push the image to a repository:
    • Docker Hub (hub.docker.com): public, with base images for many technologies and operating systems (Ubuntu, MySQL…);
    • Amazon ECR: private repositories, plus public ones in the ECR Public Gallery (gallery.ecr.aws).
  4. Pull and run the image as a container on any host.

Container services on AWS

The AWS container services: Amazon ECS, AWS's own container platform; Amazon EKS, managed open-source Kubernetes; AWS Fargate, serverless compute for both ECS and EKS; and Amazon ECR, which stores container images The AWS container services: Amazon ECS, AWS's own container platform; Amazon EKS, managed open-source Kubernetes; AWS Fargate, serverless compute for both ECS and EKS; and Amazon ECR, which stores container images

Four services to know.
  • Amazon ECS (Elastic Container Service): AWS's own container platform.
  • Amazon EKS (Elastic Kubernetes Service): AWS's managed Kubernetes (open source).
  • AWS Fargate: AWS's serverless container compute; works with both ECS and EKS.
  • Amazon ECR (Elastic Container Registry): stores container images.

In this group

Exam tips

  • "Run Docker containers on AWS" → ECS (or EKS if they already use Kubernetes).
  • "Containers with no servers to manage" → Fargate.
  • "Already using Kubernetes", "cloud-agnostic" → EKS.
  • "Store Docker images privately" → ECR.

Common traps

  • "Containers each need their own OS, like VMs." They share the host's OS kernel.
  • "Fargate is a separate container orchestrator." It's the serverless compute under ECS or EKS.

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt