Site Tools


docker

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

  1. Images
  2. Containers
  3. Dockerfile
  4. Building images
  5. Running containers
  6. Volumes
  7. Networks
  8. Registries
  9. Pulling and pushing
  10. Tagging
  11. Layers
  12. Entrypoint and CMD
  13. Environment variables
  14. Ports and networking
  15. Compose
docker.md · Last modified: