Skip to content

fix: correct bind mount example with conflicting WORKDIR#24125

Merged
dvdksn merged 1 commit intodocker:mainfrom
lacatoire:fix/issue-22637-bind-mount-example
Feb 12, 2026
Merged

fix: correct bind mount example with conflicting WORKDIR#24125
dvdksn merged 1 commit intodocker:mainfrom
lacatoire:fix/issue-22637-bind-mount-example

Conversation

@lacatoire
Copy link
Copy Markdown
Contributor

@lacatoire lacatoire commented Feb 10, 2026

Description

The bind mount example in the cache optimization guide used WORKDIR /app with go build -o /app/hello, causing the build output to be written inside the read-only bind mount target. This fails with:

copying /tmp/go-build.../exe/a.out: open /app/hello: read-only file system

Changed WORKDIR to /build so the mount target and output path don't overlap, and added a note explaining that build output must be written outside the bind mount target.

Fixes #22637

Changed WORKDIR from /app to /build so the build output path
(/app/hello) does not overlap with the read-only bind mount target.
Added clarification about writing output outside the mount point.

Fixes docker#22637
@lacatoire lacatoire requested a review from dvdksn as a code owner February 10, 2026 16:44
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 10, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 7e01972
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/698b60566689d9000865df00
😎 Deploy Preview https://deploy-preview-24125--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/build Relates to Dockerfiles or docker build command label Feb 10, 2026
Copy link
Copy Markdown
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

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

Thanks

@dvdksn dvdksn merged commit 16e5f28 into docker:main Feb 12, 2026
18 checks passed
@lacatoire lacatoire deleted the fix/issue-22637-bind-mount-example branch February 12, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example given for bind mounts is wrong

2 participants