-
Notifications
You must be signed in to change notification settings - Fork 2.1k
container/opts: Add bind-create-host-path mount option #6792
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Oh! I now recall I saw a PR from @ndeloof which I think is doing the same, but I had to think about the naming of the option (he picked
|
|
I think it should be |
|
Yeah, we probably didn't think it through properly when we named the API field 😞. For the CLI, UX doesn't have to strictly match the API naming of course. But yeah; ideally we'd rename the API field, but that may need some juggling to deprecate the old (so perhaps we'd need "both" for some time). |
|
Oh! Regardless of that; Nicolas's PR also has some documentation changes; if we continue on this PR, we should include those here (you can add him as co-authored-by). |
|
Thanks for updating; I was also brainstorming a bit on alternative, descriptive names; one option could also be |
| By default, bind mounts require the source path to exist on the host. This is a significant difference | ||
| from the <tt>-v</tt> flag, which creates the source path if it doesn't exist.<br /> | ||
| <br /> | ||
| Set <tt>bind-create-host-path</tt> to create the source path on the host if it doesn't exist.<br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should be explicit, and mention "on the daemon host", because that's where it happens.
@dvdksn perhaps you have more / other suggestions.
Add support for the `bind-create-mountpoint` option in bind mounts, which instructs the daemon to create the mountpoint directory inside the container if it doesn't exist. This allows to replace the legacy `-v /src/dir:/dst` with the `--mount`. Usage: --mount type=bind,src=/host/path,dst=/container/path,bind-create-mountpoint --mount type=bind,src=/host/path,dst=/container/path,bind-create-mountpoint=true Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
d7d9df4 to
bdd1a7a
Compare
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Add support for the
bind-create-host-pathoption in bind mounts, which instructs the daemon to create the mountpoint directory inside the container if it doesn't exist.This allows to replace the legacy
-v /src/dir:/dstwith the--mount.Usage:
--mount type=bind,src=/host/path,dst=/container/path,bind-create-host-path
--mount type=bind,src=/host/path,dst=/container/path,bind-create-host-path=true
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)