Tom's wiki

Docker

A runtime for containers.

A container is basically an isolated user space. Unlike traditional VMs, containers share the same OS.

Layers

A Docker image consists of read-only layers, each of which represents a Dockerfile instruction. Each layer is a delta of the changes from the previous layer. When a container is created from an image, a new writable layer is added on top of the underlying layers.

Storage

Types:

Both use the same -v flag, the difference is in the first argument: for a volume, it's the volume name; for a bind mount, it's a local directory path.

Dockerfile

Best practices:

Help
CMD or ENTRYPOINT? ENTRYPOINT should be used for the main command, CMD - for flags/arguments. Unlike ENTRYPOINT, CMD can be overwritten from the CLI.

Commands

Alternatives

See also