remove auto-creating non-existant volume host path#19953
remove auto-creating non-existant volume host path#19953keloyang wants to merge 1 commit intomoby:masterfrom keloyang:non-auto-create
Conversation
|
Code looks good, but you should use |
Follow up moby#19953 It'll break lots of applications if container won't start with none exist source bind volume. It could be hard for administrator to create every directories applications need. So we can add an option for daemon, to assign a safe volume which can create new directories by user's will, if none existed directories are in these editable volumes, daemon can create them when starting containers. Signed-off-by: Qiang Huang <[email protected]>
docs/deprecated.md
Outdated
There was a problem hiding this comment.
(nit) I think "has been" isn't needed here; simply "Removed in release: 1.11"
|
@keloyang need rebase and CI seems unhappy |
|
integration-cli test pass but the docker-py failed,maybe we should modify the testcase of docker-py. |
|
@LK4D4 rebased. |
|
Not sure about other contexts, but the windowsTP4 failure is genuine. |
|
I think we'll need to fix docker-py to support this. I'm pretty sure the failing tests are because that library assumes that docker creates the mount points. |
|
@keloyang I think you should update the PS: @keloyang if you're short on time, we can carry it for you 😉 |
|
@vdemeester I will change it as soon as possible. thank you. |
|
wow - the test failure at https://jenkins.dockerproject.org/job/docs-docker-pr/4223/ is due to alot of commits being merged between the creation of the PR and when the job actually ran - lets see what happens now. retest this please |
|
the newly triggered checker job failed due to the docker/tutorials repo going private: https://jenkins.dockerproject.org/job/docs-docker-pr/4228/console |
|
WindowsTP4 error looks like an issue with that node; https://jenkins.dockerproject.org/job/Docker-PRs-WoW-TP4/2323/console |
|
Oh, weird stuff; |
|
@thaJeztah, thank you very much, I will check as soon as possible. |
Signed-off-by: yangshukui <[email protected]>
| // Can't bind-mount volumes with separate host daemon. | ||
| return []string{"/vol1", "/vol2", "/vol3", "/vol_ro:/vol_ro:ro"} | ||
| for _, volume := range volumes { | ||
| dir := strings.Split(volume, ":") |
There was a problem hiding this comment.
This won't work well for Windows paths. Can we instead create the paths, and then build the volumes slice?
|
Couple of nits. |
|
Unfortunately, it seems like the cons (breaking change) outweigh the pros of this PR. As far as the Sorry @keloyang it's really not your fault there has been some misunderstanding among maintainers. I suggest opening another PR to remove the deprecation in the docs and the warning as well. |
|
I have a need in which I'm fairly certain there is no solution without a |
|
My usecase would benefit from the |
|
@YarekTyshchenko you can use the "advanced" syntax $ docker run --rm --mount type=bind,src=/no/such/dir,target=/container/path alpine
docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /no/such/dir. |
|
@thaJeztah I unfortunately don't have access to the command directly. It runs as part of microsoft's Azure IoT Edge offering. |
move from #19537
currently, docker create non-existent volume host path automatically.
e.g.
if the /hello dir don't exist in host, docker will create it to avoid the fail of mount.
But it is not reasonable.in fact,we can skip non-existant volume host path and remove "MkdirAll" from Setup.
Signed-off-by: yangshukui [email protected]