New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Split --volume / -v
into two separate options
#31010
Comments
Yup, this has been a pain point for a while (also "auto-creation" of the host directories when using a bind-mounted directory #21666), and #28527. We've been struggling to find the "right" solution; the |
Yes, I totally understand the major changes it requires, this is why I think the sooner this problem is addressed, the better it will be. I think what was done with the new Swarm Mode is on the right track: having a Any chance we might have something like this for plain, vanilla docker (i.e. when not using Swarm Mode?) |
Can we close this issue and continue the discussion in #28527 for ease of reference? |
Yeah, why not, but I think this is a different topic, it's for the syntax. What I'm asking here is to actually separate the two. From what I could read so far (but I just browsed the topic quickly), whatever format will be chosen, (whether it's And my issue is specifically this :/ But if this is covered, yeah sure, let's close (nothing worse that's duplicate issues :/) |
@nschoe Sadly we can never take away from The reason
We will also be adding the expanded mount syntax to the compose format here very soon (PR is open). |
All that to say, let's close and discuss there, as it is all relevant. |
Thanks for answering @cpuguy83 . I mean it's a major API change, sure, this is why I suggested announcing is deprecated, and then remove it in, like 5 releases (or 10, I don't know). I love docker and fro tis future, I see millions of people using it (at least I hope so), and this is the kind of "beginning mistake" that can drag a lot. And it confused so many people, this is why I pushed for a removal. The reason I think it can still be done, it that docker versions < 1.11 are still fairly "recent" and a great deal of things are not compatible (I see people coming on IRC with a problem all the time, and after a couple of minute, I learn they are running docker 1.9, after they updated their problem is gone). So I think it's still possible to break the API. Smth like make it deprecated in 17.03 and end the support in 18.03 or smth. I know I have basically no chance of convincing, but I just wanted to make my point. I basically spend my day on #docker IRC, trying to teach as many people about docker as I can between two tasks at work, I also write articles about Docker, and this is a problem that confused people every day. Eveyday some people some and ask about their postgresql setting with Anyway I made my case :) As for And I fear that after seeing one Can't we have two different commands? One for mounting a volume and one for mounting a host's directory? Some suggestions:
Anyway, thanks for talking with me about this :) |
The compose format is embedded in docker now and I would encourage people to use it since the format is much easier to deal with and has a lot more structure to it compared to insanely long CLI flags, can be committed to version control, and is effectively idempotent. But as I mentioned before, I have no problem with having some of these targeted flags (other than flag sprawl), but we need The reason |
Well.. I understand (yes I know you said As a curiosity, why no ":" for path separator? As another curiosity, hadn't the Thanks again for the info! |
re: |
Okay for And okay for the I'm just utterly sad that |
Hi,
this is not an issue, merely a feature request.
I begin to have quite some experience with docker, and I hang continually on the #docker IRC chan. I thus have a pretty good idea of the things the newcomers (or not :/) have the most issues with.
There is really a big misunderstanding of Docker Volumes. More specifically, people tend not to see the difference between creating a Docker Named Volume and mount it and sharing a host's directory.
Namely, they don't make the difference between
-v /path/in/host:/path/in/container
and-v volume-name:/path/in/container
.This is even more troublesome when they actually have it written like this
-v ./sql-data:/var/lib/data
and then we suggest them to use a Named Volume instead, by giving them the-v sql-data:/var/lib/data
!I have written an article about this here in order to try and demystify the Docker Volumes.
But that's a hard fight.
When you include the Dockerfile
VOLUME
statement, it kills the remaining few people who seemed to have understood at first.I think a lot of confusion comes from the fact that experienced people tend to talk about "volumes" indifferently when they are talking about Docker Named Volumes or Shared Host's Directory.
Therefore I think we would benefit to have a separate
--volume / -v
option which would mount a Docker Named Volume inside a container, the syntax would be the same--volume / -v volume-name:/path/inside/container
and a--mount
or even--external-mount
which would mount a host's directory inside a container.From a developer's perspective, this would not change much (a simple name check when using
--volume / -v
), but that would clearly help newcomers. Because then, when we say "volume" it would clearly mean "Docker Named Volume", and when we say "mounts" (or "external mounts") we would clearly mean "an external (thus host's) directory mounted in the container".This would be much easier to explain that "external mounts shadow existing data in the container" rather than "when you're mounting a volume to a container, the target content is shadowed, but only if this volume is a host's directory" (which is often said, but doesn't really make sense).
I know this won't be accepted and probably discarded (and I understand: it breaks API, you'd need to make both options work at the same time to make the effective switch in 4-5 major versions), but I'm just saying that I see a lot of confusion about this in IRC and this is something that I believe should be addressed.
Anyway, that was my 2 cents of the topic, what do you say?
The text was updated successfully, but these errors were encountered: