From 4aa65f26aa428c70e4d508ecfc2667532660ba13 Mon Sep 17 00:00:00 2001 From: Joseph Kern Date: Fri, 19 Dec 2014 13:25:33 +0300 Subject: [PATCH] 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 checkpoint before edits on the export functions Signed-off-by: Joseph Kern Added an --output flag to docker export and created tests. Signed-off-by: Joseph Kern White space cleanup. Signed-off-by: Joseph Kern Docker-DCO-1.1-Signed-off-by: Joseph Kern (github: jfrazelle) checkpoint before edits on the export functions Signed-off-by: Joseph Kern White space cleanup. Signed-off-by: Joseph Kern Added text to reflect a new output option for the export command. Signed-off-by: Joseph Kern Whitespace clean up Signed-off-by: Joseph Kern Added man page documentation for the new --output flag in export Signed-off-by: Joseph Kern --- docs/sources/reference/commandline/cli.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/sources/reference/commandline/cli.md b/docs/sources/reference/commandline/cli.md index 7a89426a98..f31707b565 100644 --- a/docs/sources/reference/commandline/cli.md +++ b/docs/sources/reference/commandline/cli.md @@ -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