A very simple image for launching Docker volume containers in which ownership and permissions of volume directories are set correctly.
You could accomplish the same thing with the busybox image.
This image just allows you to express the container's intent (and its consumers' expectations) more clearly.
The entry point expects CMD to be a list of one or more directory specifications:
usage: prepare-volumes [-fr] dir[:mode[:uid[:gid]]] ...
-fForce application to directories that are not mount points (default: false). Only useful in testing.
-rRun forever instead of terminating when done (default: false).
dirThe mount point of a volume (which must also be declared with
docker run -v).
modeThe desired permissions of the mount point (default:
uidThe desired numeric id of the mount point owner (default:
gidThe desired numerid id of the mount point group (default:
gid should be numeric, because even if this image happens to include a user or group name that the DVC consumer is expecting,
it is unlikely that both images will map that name to the same numeric value.
-f option is only useful in testing. It prevents the entry point from asserting that each
dir is a mount point,
which is how it prevents the mistake of specifying directories in
CMD that were not specified as volumes with docker's
-r option has two uses:
- in environments that automatically restart terminated containers, and
- in environments where
docker rm -vis used immediately following container termination.
To create a DVC for redis:
docker run --name redis-dvc \ -v /data -v /etc/redis \ sheldonh/dvc /data:755:999:999 /etc/redis:755:999:999 docker run -d --name redis --volumes-from redis-dvc redis
Note that the DVC does not run in the background with docker's
it sets up permissions and ownership and then terminates because the dvc's
-r option was not specified.