Modified `docker export` to allow an --output flag

Copied code from CmdSave into CmdExport. This should work, not an expert in the API calls being made. But it does make more sense to have a consistent export/save flag.

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

checkpoint before edits on the export functions

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

Added an --output flag to docker export and created tests.

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

White space cleanup.

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

Docker-DCO-1.1-Signed-off-by: Joseph Kern <jkern@semafour.net> (github: jfrazelle)

checkpoint before edits on the export functions

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

White space cleanup.

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

Added text to reflect a new output option for the export command.

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

Whitespace clean up

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>

Added man page documentation for the new --output flag in export

Signed-off-by: Joseph Kern <joseph.a.kern@gmail.com>
This commit is contained in:
Joseph Kern 2014-12-19 13:25:33 +03:00 committed by Tibor Vass
parent f1cb33631f
commit 4aa65f26aa
1 changed files with 11 additions and 3 deletions

View File

@ -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