Skip to content

Deprecate "--volume-driver" option #16069

Closed as not planned
Closed as not planned

Description

@thaJeztah

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

new approach

docker run -d \
    -v $(docker volume create --driver=flocker --name=volumename):/data \
    -v $(docker volume create --driver=foobar --name=something):/somewhere \
    myimage

I'd like to have this decided on for the 1.9 release, to give a clear migration path for users that currently rely on this feature.

Activity

  1. thaJeztah commented on Sep 3, 2015

    @thaJeztah
    MemberAuthor
  2. mavenugo commented on Sep 3, 2015

    @mavenugo
    Contributor

    This also aligns with the network plugin/driver UX nicely. so its a 👍

  3. added this to the 1.9.0 milestone on Sep 3, 2015
  4. thaJeztah commented on Sep 3, 2015

    @thaJeztah
    MemberAuthor

    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! ❤️

  5. cpuguy83 commented on Sep 3, 2015

    @cpuguy83
    Member

    I've always hated this, but it's also helpful if you just want to always use the same volume driver.

  6. thaJeztah commented on Sep 3, 2015

    @thaJeztah
    MemberAuthor

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

  7. cpuguy83 commented on Sep 4, 2015

    @cpuguy83
    Member

    @calavera Didn't care for that.

  8. mavenugo commented on Sep 4, 2015

    @mavenugo
    Contributor

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

  9. srust commented on Sep 4, 2015

    @srust
    Contributor

    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          
    
  10. SvenDowideit commented on Sep 7, 2015

    @SvenDowideit
    Contributor

    mmmm, so one thing I'd like is to be able to say

    docker run -v \\sambaserver\dir:/data -u sven debian bash

    and have that mount the volume so that the sven user in that container (and we may not know what the UID is until its run...) has access

    replacing that with

    docker run -v $(docker volume create --driver cifs --name some_hash \\sambaserver\dir user:sven):/data -u sven debian bash

    could work - but it doesn't fill me with docker-styling UX magic

  11. thaJeztah commented on Sep 7, 2015

    @thaJeztah
    MemberAuthor

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

  12. SvenDowideit commented on Sep 8, 2015

    @SvenDowideit
    Contributor

    yeah, my plan for that is to have a multiplexor plugin, 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)

  13. added
    kind/feature
    and removed
    kind/feature
    on Sep 8, 2015
  14. cpuguy83 commented on Sep 24, 2015

    @cpuguy83
    Member

    Who wants to do this PR to add to the deprecation file?

  15. erikh commented on Sep 25, 2015

    @erikh
    Contributor
  16. removed this from the 1.9.0 milestone on Oct 10, 2015
  17. thaJeztah commented on Oct 15, 2015

    @thaJeztah
    MemberAuthor

    Closing for now, see the discussion on #16595

    Thanks @erikh !

  18. datamattsson commented on Feb 6, 2017

    @datamattsson

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/volumesimpact/deprecationkind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions