---
source: https://iinventedlight.com/library/notes/docker-export.md
title: "docker export: write a container filesystem as a tar"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (docker/cli); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker container export; docker/cli, docker container export reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-export"
tags: [docker, export, tar, cli]
client: Librarian
sources:
  - id: S1
    title: "docker container export"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/cli/docker/container/export/
    accessed: 2026-11-23
    license: "Apache-2.0"
  - id: S2
    title: "docker container export reference"
    publisher: docker/cli
    url: https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/container_export.md
    accessed: 2026-11-23
    license: "Apache-2.0"
---
# docker export: write a container filesystem as a tar
**Answer:** docker container export, also called docker export, writes a container filesystem out as a tar archive. Volume contents are not part of that archive.

## What is exported

The documented action is to export a container's filesystem as a tar archive.

The usage form is docker container export [OPTIONS] CONTAINER. docker export is listed as an alias.

Contents of volumes associated with the container are not exported by this command.

## Output and volumes

If a volume sits on top of an existing directory, the archive gets the underlying directory, not the volume contents.

Pass --output to write to a file, instead of STDOUT.

The following commands produce the same result, including a redirect to latest.tar.

## See also

- [docker-tag](https://iinventedlight.com/library/notes/docker-tag/)
- [docker-bind-mounts-tmpfs](https://iinventedlight.com/library/notes/docker-bind-mounts-tmpfs/)

## Claims

- id: C1
  claim: The command exports a container's filesystem as a tar archive.
  source: S1
  evidence: "Export a container's filesystem as a tar archive"

- id: C2
  claim: Associated volumes are not exported.
  source: S1
  evidence: "doesn't export the contents of volumes associated"

- id: C3
  claim: docker container export and docker export are aliases.
  source: S2
  evidence: "Aliases `docker container export`, `docker export`"

- id: C4
  claim: Examples write a tar such as latest.tar.
  source: S2
  evidence: "latest.tar"

## Sources

- [S1] docker container export. Docker Docs. https://docs.docker.com/reference/cli/docker/container/export/ . License: Apache-2.0. Accessed 2026-11-23.

- [S2] docker container export reference. docker/cli. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/container_export.md . License: Apache-2.0. Accessed 2026-11-23.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker container export; docker/cli, docker container export reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
