← All lessons
Docker
All Docker snippets · 186
Every snippet has its own focus page with an explanation and the output it produces.
Dockerfile Basics · 14
- Minimal image
- Untagged base image
- Running a build command
- Split RUN loses the cache
- Setting the working directory
- cd does not persist
- Default container command
- Copying project files
- Documenting a port
- EXPOSE does not publish
- Full Dockerfile skeleton
- Building and tagging
- Alternate Dockerfile path
- Context outside the Dockerfile
Base Images · 8
Layers & Caching · 9
COPY & ADD · 9
ENV & ARG · 10
CMD & ENTRYPOINT · 8
Multi-stage Builds · 8
Users & Security · 9
Healthcheck & Signals · 7
Volumes & Storage · 10
Networking · 10
CLI: Containers · 12
CLI: Images · 8
Compose Basics · 15
- Single service
- Building from a Dockerfile
- Starting the stack
- down removes the network
- depends_on does not wait for readiness
- Waiting on a healthcheck
- Environment from a file
- Named volume in compose
- Custom networks
- Running multiple replicas
- Scaling with a fixed port
- Following stack logs
- Running a command in a service
- One-off task container
- Rendering the final config