Flatten a container filesystem to a single tar - no layers, no history.
docker export serializes a container filesystem (not an image) to a tar archive. It pairs with docker import. This page covers when to use it versus docker save.
What it does
docker export writes the current filesystem of a container as a flat tar. It drops layer history, image metadata, ENTRYPOINT/CMD, and environment - those live in image config, not the filesystem.
A frequent surprise: an image built from docker export | docker import "loses" its CMD/ENTRYPOINT and starts nothing, because export discards image config. If you need a runnable image with metadata, use docker save/load instead. export needs a container ID, not an image name - create one first with docker create.
Frequently asked questions
docker export: Export a Container Filesystem?
docker export serializes a container filesystem (not an image) to a tar archive. It pairs with docker import. This page covers when to use it versus docker save.
What it does?
docker export writes the current filesystem of a container as a flat tar. It drops layer history, image metadata, ENTRYPOINT/CMD, and environment - those live in image config, not the filesystem.
Common errors in CI?
A frequent surprise: an image built from docker export | docker import "loses" its CMD/ENTRYPOINT and starts nothing, because export discards image config. If you need a runnable image with metadata, use docker save/load instead. export needs a container ID, not an image name - create one first with docker create.