Skip to content

Conversation

@lacatoire
Copy link
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

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
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

1 participant