You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The --volume-driver option was never a good fit; this option can only be specified once, which isn't really useful if a container uses multiple volumes (and different drivers need to be used for each one)
Now that volume create command has been merged, I think we should deprecate --volume-driver in favor of volume create, i.e.:
old approach
docker run -d -v volumename:/data --volume-driver=flocker myimage
I'll add my proposals to the milestone; I hope I won't be stepping on someone's toes doing that, but I think it's important to have given them some thought. Feel free to remove them from the milestone though! ❤️
@cpuguy83 oh! I was actually thinking (perhaps a different issue); should we have a --default-volume-driver on the daemon; could be useful if I want to use a special driver on my host (instead of 'local')
@thaJeztah yes. --default-volume-driver also makes it consistent with --default-network-driver that we have in experimental. Since the plugins by definition are remote to the daemon (in the same host) and the recommended approach is to be running the plugins as docker containers, we would want to make sure that the plugin containers are loaded first before user containers (think of system containers). Infact there are other cases which calls for this requirement of differentiating system containers vs application containers. @icecrime@calavera we discussed about this in the past. Any chance of making that happen for 1.9 ?
We would also support a proposal for a system container vs. application container split. For volume plugins in 1.9, however, we worked around this issue by creating a retry mechanism in docker. If the plugin is not yet available (its container is currently starting), other containers that depend on it will retry. Retries are not ideal (as they do timeout eventually), but it does work in general.
For example, the blockbridge volume plugin runs as a container and you'll see the plugin lookup retry like:
WARN[0000] Unable to locate plugin: blockbridge, retrying in 1s
DEBU[0000] Starting container 76e3e66e8b764a0b6bd2e38b38798c7989a6da4bed23a031ecb95914d82af24b
DEBU[0000] activateDeviceIfNeeded(76e3e66e8b764a0b6bd2e38b38798c7989a6da4bed23a031ecb95914d82af24b)
DEBU[0001] blockbridge's manifest: &{[VolumeDriver]}
DEBU[0001] blockbridge implements: VolumeDriver
INFO[0003] Daemon has completed initialization
@SvenDowideit true, but in situations where multiple drivers are needed, --volume-driver won't work, for example;
docker run \
-v C:\Users\Sven\docs:/docs \
-v \\sambaserver\dir:/data \
--volume-driver cifs \
-u sven \
debian bash
Will use the cifs driver for all volumes, including "volumes" defined in the Dockerfile (see #15122).
Whereas something like;
docker run \
-v C:\Users\Sven\docs:/docs \
-v $(docker volume create --driver cifs \\sambaserver\dir):/data \
-u sven
debian bash
Would only use the cifs driver for the \\sambaserver volume, but the "local" driver for the other volume. (Not sure what the user:sven part was in your example, so I left that out)
Activity
thaJeztah commentedon Sep 3, 2015
/cc @cpuguy83 @calavera @icecrime
mavenugo commentedon Sep 3, 2015
This also aligns with the network plugin/driver UX nicely. so its a 👍
thaJeztah commentedon Sep 3, 2015
Thanks for your input, @mavenugo
I'll add my proposals to the milestone; I hope I won't be stepping on someone's toes doing that, but I think it's important to have given them some thought. Feel free to remove them from the milestone though! ❤️
cpuguy83 commentedon Sep 3, 2015
I've always hated this, but it's also helpful if you just want to always use the same volume driver.
thaJeztah commentedon Sep 3, 2015
@cpuguy83 oh! I was actually thinking (perhaps a different issue); should we have a
--default-volume-driveron the daemon; could be useful if I want to use a special driver on my host (instead of 'local')cpuguy83 commentedon Sep 4, 2015
@calavera Didn't care for that.
mavenugo commentedon Sep 4, 2015
@thaJeztah yes.
--default-volume-driveralso makes it consistent with--default-network-driverthat we have in experimental. Since the plugins by definition are remote to the daemon (in the same host) and the recommended approach is to be running the plugins as docker containers, we would want to make sure that the plugin containers are loaded first before user containers (think of system containers). Infact there are other cases which calls for this requirement of differentiating system containers vs application containers. @icecrime @calavera we discussed about this in the past. Any chance of making that happen for 1.9 ?srust commentedon Sep 4, 2015
We would also support a proposal for a system container vs. application container split. For volume plugins in 1.9, however, we worked around this issue by creating a retry mechanism in docker. If the plugin is not yet available (its container is currently starting), other containers that depend on it will retry. Retries are not ideal (as they do timeout eventually), but it does work in general.
For example, the blockbridge volume plugin runs as a container and you'll see the plugin lookup retry like:
SvenDowideit commentedon Sep 7, 2015
mmmm, so one thing I'd like is to be able to say
docker run -v \\sambaserver\dir:/data -u sven debian bashand have that mount the volume so that the
svenuser in that container (and we may not know what the UID is until its run...) has accessreplacing that with
docker run -v $(docker volume create --driver cifs --name some_hash \\sambaserver\dir user:sven):/data -u sven debian bashcould work - but it doesn't fill me with docker-styling UX magic
thaJeztah commentedon Sep 7, 2015
@SvenDowideit true, but in situations where multiple drivers are needed,
--volume-driverwon't work, for example;Will use the
cifsdriver for all volumes, including "volumes" defined in the Dockerfile (see #15122).Whereas something like;
Would only use the
cifsdriver for the\\sambaservervolume, but the "local" driver for the other volume. (Not sure what theuser:svenpart was in your example, so I left that out)SvenDowideit commentedon Sep 8, 2015
yeah, my plan for that is to have a
multiplexorplugin, which then tries the other drivers i want til it gets a success.in essence, we get to the point where we're polling all volume plugins asking 'is this yours'?
and for that, I would also love it to be a daemon setting, and additionally apply to all volumes requests :)
mind you - i need to think about the volumes in Dockerfiles thing - that sounds like it has interesting potential (for good and bad)
cpuguy83 commentedon Sep 24, 2015
Who wants to do this PR to add to the deprecation file?
erikh commentedon Sep 25, 2015
#16595
thaJeztah commentedon Oct 15, 2015
Closing for now, see the discussion on #16595
Thanks @erikh !
datamattsson commentedon Feb 6, 2017
@mavenugo did the --default-volume-driver ever surface in a release? I'm on 1.12.3-cs4 and it does not accept the parameter to dockerd.