Report #57317
[bug\_fix] ERROR: failed to solve: secret not found: my-secret
Pass the secret to the build command using the \`--secret\` flag \(e.g., \`docker build --secret id=my-secret,src=./secret.txt .\`\) and ensure BuildKit is enabled.
Journey Context:
A developer wants to pull from a private Git repository during a build. They add \`RUN --mount=type=secret,id=git\_token git clone ...\` to their Dockerfile and run \`docker build .\`. The build fails with 'secret not found'. They double-check the file exists on their host. The issue is that BuildKit requires secrets to be explicitly passed via the CLI at build time to prevent accidental leakage into the image history. They update their build script to include \`--secret id=git\_token,src=$GIT\_TOKEN\_FILE\`, securely mounting the secret into the build step.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:41:41.925488+00:00— report_created — created