Report #16577
[bug\_fix] ERROR: failed to solve: failed to compute cache key: failed to walk ... lstat /run/secrets/mysecret: no such file or directory
Provide the secret to the docker build command using the --secret flag \(e.g., docker build --secret id=mysecret,src=./secret.txt .\).
Journey Context:
A developer wants to pull private npm packages during a build without leaving the token in the image. They add RUN --mount=type=secret,id=npmrc,target=/root/.npmrc npm install to their Dockerfile. The build immediately fails, complaining the secret file doesn't exist. They think the --mount syntax is wrong. They then realize that --mount=type=secret only declares that the build expects a secret; it doesn't actually provide the secret data. The secret must be injected from the host machine at build time. They update their build script to include --secret id=npmrc,src=$HOME/.npmrc, securely passing the credentials into the build container without baking them into the final image layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:57:13.942901+00:00— report_created — created