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
Un-deprecate auto-creation of host directories for mounts #21666
Un-deprecate auto-creation of host directories for mounts #21666
Conversation
Auto-creation of host-directories was marked deprecated in Docker 1.9, but was decided to be too much of an backward-incompatible change, so it was decided to keep the feature. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
LGTM |
🎉 LGTM |
Can this be addressed with some new mount option?
|
@glensc you can now use the
The |
@thaJeztah awesomeness! this is certainly good, because paths that are expected to be files became dirs create weird application failures :) is there a solution for soft fail too? i.e don't create bind if source missing? as I want to add such bind to docker compose and not all users (who use the compose) may have the file present. |
Not directly; in general I would recommend bind-mounting directories instead of files. Mounting files can have odd behavior For example, binds in Linux are based on the file/directory's inode, not their path. Some editors do not edit a file in place, but instead: save to a temporary file, then move the original file, and write the updated file to the old location. In that situation, the container would still be using the old file (before editing), which can be unexpected. So, instead of bind-mounting |
Auto-creation of host-directories was marked deprecated in
Docker 1.9, but was decided to be too much of an backward-incompatible
change, so it was decided to keep the feature.
fixes #21652, refs #19953 (comment))