Dockerfile.local: place COPY targets under /out#153
Merged
milan-zededa merged 1 commit intoMay 15, 2026
Conversation
The build stage uses WORKDIR /out, but the three COPY directives went to absolute paths at root (/bin, /adam, /bin/adam). The final scratch stage does `COPY --from=build /out/ /`, which only picks up files under /out — so scripts, samples, and the adam binary itself were silently dropped from the image. Result: `make image-local` (documented in README.md as a recommended quick reproducible build path) produces an image without /bin/adam. Running it fails with `"/bin/adam": stat /bin/adam: no such file or directory`. Fix: redirect the COPY destinations to /out/bin/, /out/adam/, and /out/bin/adam so the scratch stage finds them. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
milan-zededa
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make image-local(documented inREADME.mdas the recommended quickreproducible build path) currently produces an image without
/bin/adam. Running such an image fails immediately with:Root cause
Dockerfile.local's build stage setsWORKDIR /outbut the threeCOPYdirectives target absolute paths at root:Absolute paths in
COPYare not joined withWORKDIR, so thefiles land at
/bin,/adam, and/bin/adamin the build stage'sfilesystem.
The final scratch stage then does:
…which copies only what's under
/out/. The scripts, samples, andadam binary at the build-stage root are silently dropped from the
final image.
The non-
.localDockerfile(used for CI / Docker Hub builds) doesthis correctly —
RUN go build -o /out/bin/adam main.go,COPY scripts/ /out/bin/,COPY samples/ /out/adam/. OnlyDockerfile.localhas the bug.Fix
Redirect the three COPY destinations to
/out/bin/,/out/adam/,and
/out/bin/adamso the scratch stage picks them up.How to test
Before this patch, on master HEAD:
After this patch:
The actual
make image-localflow (which callsmake buildfirst onmy local machine has an unrelated go.mod-version vs. pinned-golang
issue), but the Dockerfile change itself is independently verifiable
by building it directly with a pre-existing
bin/adam-linux-amd64,which I've done locally as shown above.