From eba678647bc67e2d27da0d99a0e697835b1d7c94 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Mon, 14 Mar 2016 23:31:42 -0400 Subject: [PATCH] Add explicit flags for volume cp/no-cp This allows a user to specify explicitly to enable automatic copying of data from the container path to the volume path. This does not change the default behavior of automatically copying, but does allow a user to disable it at runtime. Signed-off-by: Brian Goff --- docs/reference/commandline/create.md | 8 ++++---- docs/reference/commandline/run.md | 8 ++++---- docs/reference/run.md | 11 ++++++++--- man/docker-create.1.md | 4 ++++ man/docker-run.1.md | 4 ++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/create.md index 6128411c5f..70c0e4c35a 100644 --- a/docs/reference/commandline/create.md +++ b/docs/reference/commandline/create.md @@ -90,10 +90,10 @@ Creates a new container. --uts="" UTS namespace to use -v, --volume=[host-src:]container-dest[:] Bind mount a volume. The comma-delimited - `options` are [rw|ro], [z|Z], or - [[r]shared|[r]slave|[r]private]. The - 'host-src' is an absolute path or a name - value. + `options` are [rw|ro], [z|Z], + [[r]shared|[r]slave|[r]private], and + [nocopy]. The 'host-src' is an absolute path + or a name value. --volume-driver="" Container's volume driver --volumes-from=[] Mount volumes from the specified container(s) -w, --workdir="" Working directory inside the container diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index a3ef21f79b..97553a67dc 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -92,10 +92,10 @@ parent = "smn_cli" --uts="" UTS namespace to use -v, --volume=[host-src:]container-dest[:] Bind mount a volume. The comma-delimited - `options` are [rw|ro], [z|Z], or - [[r]shared|[r]slave|[r]private]. The - 'host-src' is an absolute path or a name - value. + `options` are [rw|ro], [z|Z], + [[r]shared|[r]slave|[r]private], and + [nocopy]. The 'host-src' is an absolute path + or a name value. --volume-driver="" Container's volume driver --volumes-from=[] Mount volumes from the specified container(s) -w, --workdir="" Working directory inside the container diff --git a/docs/reference/run.md b/docs/reference/run.md index 65271a285f..7edcd7e16a 100644 --- a/docs/reference/run.md +++ b/docs/reference/run.md @@ -1400,13 +1400,18 @@ The example below mounts an empty tmpfs into the container with the `rw`, ### VOLUME (shared filesystems) -v, --volume=[host-src:]container-dest[:]: Bind mount a volume. - The comma-delimited `options` are [rw|ro], [z|Z], or - [[r]shared|[r]slave|[r]private]. The 'host-src' is an absolute path or a - name value. + The comma-delimited `options` are [rw|ro], [z|Z], + [[r]shared|[r]slave|[r]private], and [nocopy]. + The 'host-src' is an absolute path or a name value. If neither 'rw' or 'ro' is specified then the volume is mounted in read-write mode. + The `nocopy` modes is used to disable automatic copying requested volume + path in the container to the volume storage location. + For named volumes, `copy` is the default mode. Copy modes are not supported + for bind-mounted volumes. + --volumes-from="": Mount all volumes from the given container(s) > **Note**: diff --git a/man/docker-create.1.md b/man/docker-create.1.md index 376f8308a5..f12edb5483 100644 --- a/man/docker-create.1.md +++ b/man/docker-create.1.md @@ -434,6 +434,10 @@ change propagation properties of source mount. Say `/` is source mount for > is `slave`, you may not be able to use the `shared` or `rshared` propagation on > a volume. + +To disable automatic copying of data from the container path to the volume, use +the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes. + **--volume-driver**="" Container's volume driver. This driver creates volumes specified either from a Dockerfile's `VOLUME` instruction or from the `docker run -v` flag. diff --git a/man/docker-run.1.md b/man/docker-run.1.md index d63a0b6452..57808f33a0 100644 --- a/man/docker-run.1.md +++ b/man/docker-run.1.md @@ -531,6 +531,7 @@ any options, the systems uses the following options: * [rw|ro] * [z|Z] * [`[r]shared`|`[r]slave`|`[r]private`] + * [nocopy] The `CONTAINER-DIR` must be an absolute path such as `/src/docs`. The `HOST-DIR` can be an absolute path or a `name` value. A `name` value must start with an @@ -603,6 +604,9 @@ change propagation properties of source mount. Say `/` is source mount for > is `slave`, you may not be able to use the `shared` or `rshared` propagation on > a volume. +To disable automatic copying of data from the container path to the volume, use +the `nocopy` flag. The `nocopy` flag can be set on bind mounts and named volumes. + **--volume-driver**="" Container's volume driver. This driver creates volumes specified either from a Dockerfile's `VOLUME` instruction or from the `docker run -v` flag.