docker create
Prepares a container from an image, with its writable layer and settings, without starting it.
In more detail
It prints the new container ID and leaves the container in the created state. Separating create from start makes each lifecycle step observable; docker run does both at once.
Example
docker create --name lifecycle-demo alpine:3.20 sleep 30Related terms
- docker start — Starts a container that already exists, keeping its writable layer and settings.
- docker run — Creates a new container from an image and starts it, in one step.
- container lifecycle — The stages a container passes through: created, running, paused, stopped (exited) and removed.
Taught in
- Run, Stop, Restart And Remove A Container — Docker Architecture & Production Containers
- FROM, WORKDIR, COPY And ADD — Docker Architecture & Production Containers
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- Ephemeral Filesystems And Named Volumes — Docker Architecture & Production Containers
- Bind Mounts, Permissions And Backups — Docker Architecture & Production Containers