Table of Contents

Docker

Docker is a containerization platform that packages your application and its dependencies into a lightweight, portable unit called a container. Run docker run to start a container from an image; it starts instantly and includes everything your app needs—no “works on my machine” problems.

An image is a blueprint: a layered filesystem snapshot plus metadata. A container is a running instance of an image, with its own isolated filesystem, network, and environment. Build images from a Dockerfile, run containers from images, and share images via a registry (Docker Hub, private registries, etc.).

$ docker build -t myapp .     # build an image from Dockerfile
$ docker run myapp            # run a container from an image
$ docker push myapp           # push image to registry
$ docker pull myapp           # pull image from registry

Containers are ephemeral by default—data disappears when they stop. Use volumes for persistent storage, networks to link containers, and Compose to orchestrate multi-container apps.

Concepts