-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Proposal - Allow for different types of volumes #9803
Comments
Given how GitHub makes it difficult to follow long running discussions, I'm going to try something out and use this first comment to consolidate feedbacks already taken into account. I hope people won't mind me deleting comments: I'll copy them verbatim, I just want to avoid comments count explosion. From @thaJeztah:
Fixed, thanks! From @tianon:
From @tianon:
Renamed |
Some more thoughts. Sorry for the length, I'm also not sure all of these comments should be put here or in the other proposal, so correct me if I should put them over there. Is name required? I don't know if name should be a required option. As long as docker returns the ID of the created volume, we could use the same random naming as is used for containers? type "host" I think the same can be achieved by specifying (or skipping)
Possibly, Host path syntax for docker-run
I think I'd prefer having this more explicit, and not combine the options in a single flag.
Alternatively, use a more generic flag to specify options for the volume to create ( Handling conflicting options What should happen if I specify different options during
Specifying multiple volumes on docker run How would creating multiple volumes during docker run work? How will docker know which flags should be for which volume? Should "docker run" support all these? Not sure if I think it will be harder to maintain as well, both from a "technical" viewpoint and from a "project organisation" viewpoint, because adding options to Personally, I'd only make minor changes to Related proposal and "pluggable" I think this proposal; #9250 is also related here. I think the "engine" used to create a volume should be pluggable and be able to have its own options. What kind of driver and where the actual data is stored should be transparent to the container. |
Is name require? I don't think Type host I believe our idea that mounting a host directory as a volume is only a particular case of data volumes comes from the fact that a data volume is currently implemented as a directory on the host. They are conceptually quite different, but the current implementation make them very similar. What if tomorrow we support alternative volume drivers and I decide to store my data volume in a database? Host path syntax for docker-run That's indeed a difficult debate... I think we need something generic, the question is: do we want named arguments ( Conflicting options Because Specifying multiple volumes in a Should "docker run" support all these? Well that's the point of using Related proposal and "pluggable" I'm discovering that one: added to reading list :-) |
I would suggest that we have at least one hard coded name tmpfs docker run -v tmpfs:/tmp ... Although I would like tmpfs to tar all content of the target directory from the image into memory and then untar it onto the tmpfs. |
Throwing out a possible
The "mode-and-volume-params" is the new suggestion. Volume params would
This could solve the Specifying multiple volumes in a docker run question.
|
Sorry, I still didn't take the time to look into the last comments and related PRs... It's on my TODO list, promise! |
It seems that volumes from a driver should be prepopulated as Docker does that with |
It is a real shame that we don't have something here yet. We were working on and proposing this months ago. It actually is a nice secure way to run read/only containers, but here we are 6 months later and still no way to do it. Sad. |
@rhatdan We can move forward with this once the top-level volumes command is there. All is getting easier here. |
Now that @ibuildthecloud I agree with pre-populating volumes, I think we can keep that for a separate discussion (I think there are some existing ones) |
Issue statement
Volumes today can come in different flavors, but always with the underlying idea of persistent data. The recent submission of a
--tmpfs
PR (#9586) raised interesting questions:tmpfs
meaningful on other systems?This proposal only aims at offering a place to discuss this particular aspect of volumes management and hopefully providing UX input for #8484.
Proposal
A volume should be about granting special properties to a directory inside a container. That special meaning depends on the nature of the volume being mounted:
The key aspect of the proposal is that it allows to discuss properties rather than particular implementation:
tmpfs
doesn't exist on some systems while the notion of ephemerality is universal.Proposed UX
What is true for all volumes types:
docker volume create
command has a--type=(persistent|host|ephemeral|...)
argumentdocker run -v <volume_name_or_id>:/path/in/container/[:mode]
docker run
command line arguments:--volume-type=(persistent|host|ephemeral|...)
--volume-name
flagEach type of volume might require specific parameters to be passed at creation time (such as the host path in case of a host-bound volume):
docker volume create
args are appended as colon separated values to the--type
flagdocker run
command args are appended as colon separated values to the--volume-type
flagExamples
The two following examples are equivalent:
Ping @cpuguy83 @crosbymichael @shykes
The text was updated successfully, but these errors were encountered: