Skip to content

Comments

fix: check Docker Engine version for create_host_path: false support#13605

Open
Aliexe-code wants to merge 1 commit intodocker:mainfrom
Aliexe-code:fix/create-host-path-version-check
Open

fix: check Docker Engine version for create_host_path: false support#13605
Aliexe-code wants to merge 1 commit intodocker:mainfrom
Aliexe-code:fix/create-host-path-version-check

Conversation

@Aliexe-code
Copy link

Added an API version check for the CreateMountpoint bind mount option, which was introduced in Docker Engine API v1.42 (Engine v23.0).

Previously, when using create_host_path: false on 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: false on an unsupported Docker Engine, they receive a clear error message: bind mount create_host_path: false requires Docker Engine v23 or later

Changes:

  • Added apiVersion142 constant for Docker Engine 23.0
  • Added dockerEngineV23 version string for error messages
  • Added API version check in buildContainerVolumes()
  • Updated tests to use mocks and added test case for the new error path
  • Bonus: removed duplicate RuntimeVersion() call in TypeImage case

Related issue

Fixes: #13602

@Aliexe-code Aliexe-code requested a review from a team as a code owner February 22, 2026 03:49
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>
@Aliexe-code Aliexe-code force-pushed the fix/create-host-path-version-check branch from d2077df to e977fc2 Compare February 22, 2026 03:53
Copy link
Contributor

@ndeloof ndeloof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't fix #13602 as reported is running docker engine v29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] bind.create_host_path: false is ignored and missing host path is still auto-created

2 participants