fix: check Docker Engine version for create_host_path: false support#13605
Open
Aliexe-code wants to merge 1 commit intodocker:mainfrom
Open
fix: check Docker Engine version for create_host_path: false support#13605Aliexe-code wants to merge 1 commit intodocker:mainfrom
Aliexe-code wants to merge 1 commit intodocker:mainfrom
Conversation
The CreateMountpoint option for bind mounts was introduced in Docker Engine API v1.42 (Engine v23.0). Previously, when using create_host_path: false on an older Docker Engine, the setting was silently ignored and the host path was created anyway. This change adds an API version check that fails early with a clear error message when a user tries to use create_host_path: false on Docker Engine earlier than v23.0. Fixes: docker#13602 Signed-off-by: Aliexe-code <terminalexe1@gmail.com>
d2077df to
e977fc2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an API version check for the
CreateMountpointbind mount option, which was introduced in Docker Engine API v1.42 (Engine v23.0).Previously, when using
create_host_path: falseon an older Docker Engine (< v23.0), the setting was silently ignored and the host path was created anyway. This caused unexpected behavior for users who relied on strict pre-created runtime directories.Now, when a user attempts to use
create_host_path: falseon an unsupported Docker Engine, they receive a clear error message: bind mount create_host_path: false requires Docker Engine v23 or laterChanges:
apiVersion142constant for Docker Engine 23.0dockerEngineV23version string for error messagesbuildContainerVolumes()RuntimeVersion()call inTypeImagecaseRelated issue
Fixes: #13602