Skip to content

Validate bind source for create_host_path false#13889

Open
scarab-systems wants to merge 1 commit into
docker:mainfrom
scarab-systems:13602-create-host-path-false
Open

Validate bind source for create_host_path false#13889
scarab-systems wants to merge 1 commit into
docker:mainfrom
scarab-systems:13602-create-host-path-false

Conversation

@scarab-systems

@scarab-systems scarab-systems commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What I did

Added Compose-side validation for bind mounts that set bind.create_host_path: false.

Compose now returns a missing bind source error before container creation when the resolved bind source path does not exist. This keeps the create_host_path: false contract enforced without relying on daemon or Desktop path handling.

I also added unit and end-to-end coverage for docker compose run --rm with a missing long-syntax bind source.

Related issue

Related to #13602

Validation

  • go test ./pkg/compose -run 'TestBuildContainerVolumesReturnsErrorWhenBindSourceMissingAndCreateHostPathFalse|Test_buildContainerVolumes' -count=1
  • go build -trimpath -tags e2e -o bin/build/docker-compose ./cmd
  • go test -v -count=1 ./pkg/e2e -run TestRunDoesNotCreateMissingBindSourceWhenCreateHostPathIsFalse
  • docker buildx bake lint

@scarab-systems scarab-systems marked this pull request as ready for review June 30, 2026 08:09
@scarab-systems scarab-systems requested a review from a team as a code owner June 30, 2026 08:09
@scarab-systems scarab-systems requested review from glours and ndeloof June 30, 2026 08:09
@scarab-systems scarab-systems changed the title Cover create_host_path false bind source Validate bind source for create_host_path false Jun 30, 2026
Return an error before container creation when a bind mount explicitly disables host path creation and the resolved source path is missing. Add unit and end-to-end coverage for the create_host_path:false bind-source contract.

Signed-off-by: Scarab Systems <scarab.systems@yahoo.com>
@scarab-systems scarab-systems force-pushed the 13602-create-host-path-false branch from 13e158f to fbde4b9 Compare June 30, 2026 08:22
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.

1 participant