github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/container_export.md (about)

     1  # export
     2  
     3  <!---MARKER_GEN_START-->
     4  Export a container's filesystem as a tar archive
     5  
     6  ### Aliases
     7  
     8  `docker container export`, `docker export`
     9  
    10  ### Options
    11  
    12  | Name             | Type     | Default | Description                        |
    13  |:-----------------|:---------|:--------|:-----------------------------------|
    14  | `-o`, `--output` | `string` |         | Write to a file, instead of STDOUT |
    15  
    16  
    17  <!---MARKER_GEN_END-->
    18  
    19  ## Description
    20  
    21  The `docker export` command doesn't export the contents of volumes associated
    22  with the container. If a volume is mounted on top of an existing directory in
    23  the container, `docker export` exports the contents of the underlying
    24  directory, not the contents of the volume.
    25  
    26  Refer to [Backup, restore, or migrate data volumes](https://docs.docker.com/storage/volumes/#back-up-restore-or-migrate-data-volumes)
    27  in the user guide for examples on exporting data in a volume.
    28  
    29  ## Examples
    30  
    31  The following commands produce the same result.
    32  
    33  ```console
    34  $ docker export red_panda > latest.tar
    35  ```
    36  
    37  ```console
    38  $ docker export --output="latest.tar" red_panda
    39  ```