github.com/sld880311/docker@v0.0.0-20200524143708-d5593973a475/docs/reference/commandline/export.md (about)

     1  ---
     2  title: "export"
     3  description: "The export command description and usage"
     4  keywords: "export, file, system, container"
     5  ---
     6  
     7  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # export
    17  
    18  ```markdown
    19  Usage:  docker export [OPTIONS] CONTAINER
    20  
    21  Export a container's filesystem as a tar archive
    22  
    23  Options:
    24        --help            Print usage
    25    -o, --output string   Write to a file, instead of STDOUT
    26  ```
    27  
    28  ## Description
    29  
    30  The `docker export` command does not export the contents of volumes associated
    31  with the container. If a volume is mounted on top of an existing directory in
    32  the container, `docker export` will export the contents of the *underlying*
    33  directory, not the contents of the volume.
    34  
    35  Refer to [Backup, restore, or migrate data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes)
    36  in the user guide for examples on exporting data in a volume.
    37  
    38  ## Examples
    39  
    40  Each of these commands has the same result.
    41  
    42  ```bash
    43  $ docker export red_panda > latest.tar
    44  ```
    45  
    46  ```bash
    47  $ docker export --output="latest.tar" red_panda
    48  ```