mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Merge pull request #11430 from jfrazelle/export_outputflag
Modified `docker export` to allow an --output flag
This commit is contained in:
@@ -14,17 +14,24 @@ Export the contents of a container's filesystem using the full or shortened
|
||||
container ID or container name. The output is exported to STDOUT and can be
|
||||
redirected to a tar file.
|
||||
|
||||
Stream to a file instead of STDOUT by using **-o**.
|
||||
|
||||
# OPTIONS
|
||||
**--help**
|
||||
Print usage statement
|
||||
**-o**, **--output**=""
|
||||
Write to a file, instead of STDOUT
|
||||
|
||||
# EXAMPLES
|
||||
Export the contents of the container called angry_bell to a tar file
|
||||
called test.tar:
|
||||
called angry_bell.tar:
|
||||
|
||||
# docker export angry_bell > test.tar
|
||||
# ls *.tar
|
||||
test.tar
|
||||
# docker export angry_bell > angry_bell.tar
|
||||
# docker export --output=angry_bell-latest.tar angry_bell
|
||||
# ls -sh angry_bell.tar
|
||||
321M angry_bell.tar
|
||||
# ls -sh angry_bell-latest.tar
|
||||
321M angry_bell-latest.tar
|
||||
|
||||
# See also
|
||||
**docker-import(1)** to create an empty filesystem image
|
||||
@@ -34,3 +41,4 @@ and import the contents of the tarball into it, then optionally tag it.
|
||||
April 2014, Originally compiled by William Henry (whenry at redhat dot com)
|
||||
based on docker.com source material and internal work.
|
||||
June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
|
||||
Janurary 2015, updated by Joseph Kern (josephakern at gmail dot com)
|
||||
|
||||
@@ -1068,14 +1068,22 @@ This will create a new Bash session in the container `ubuntu_bash`.
|
||||
|
||||
## export
|
||||
|
||||
Usage: docker export CONTAINER
|
||||
Usage: docker export [OPTIONS] CONTAINER
|
||||
|
||||
Export the contents of a filesystem as a tar archive to STDOUT
|
||||
Export the contents of a filesystem to a tar archive (streamed to STDOUT by default)
|
||||
|
||||
For example:
|
||||
-o, --output="" Write to a file, instead of STDOUT
|
||||
|
||||
Produces a tarred repository to the standard output stream.
|
||||
|
||||
For example:
|
||||
|
||||
$ sudo docker export red_panda > latest.tar
|
||||
|
||||
Or
|
||||
|
||||
$ sudo docker export --output="latest.tar" red_panda
|
||||
|
||||
> **Note:**
|
||||
> `docker export` does not export the contents of volumes associated with the
|
||||
> container. If a volume is mounted on top of an existing directory in the
|
||||
|
||||
Reference in New Issue
Block a user