Go multi-stage build copies the wrong binary
Summary: The builder stage writes /out/server, but the runtime stage tries to copy and execute /out/api.
Failure type: multistage_artifact_mismatch
Ecosystem: go
Difficulty: easy

Repository files:
path: Dockerfile
content: FROM golang:1.23-alpine AS build
WORKDIR /src
COPY go.mod ./
COPY main.go ./
RUN go build -o /out/server ./...
FROM alpine:3.20
COPY --from=build /out/api /usr/local/bin/api
CMD ["api"]
path: go.mod
content: module example.com/sabnock/sbd0003
go 1.23
path: main.go
content: package main
import "fmt"
func main() {
    fmt.Println("ok")
}

Failure log:
failed to solve: failed to compute cache key: failed to calculate checksum of ref: "/out/api": not found

Build command: docker build -t sabnock/sbd-0003 .
Verify commands:
docker build -t sabnock/sbd-0003 .

Oracle patch:
diff --git a/Dockerfile b/Dockerfile
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,6 +3,6 @@
 COPY go.mod ./
 COPY main.go ./
 RUN go build -o /out/server ./...
 FROM alpine:3.20
-COPY --from=build /out/api /usr/local/bin/api
-CMD ["api"]
+COPY --from=build /out/server /usr/local/bin/server
+CMD ["server"]

Scoring - must touch:
Dockerfile
Scoring - must contain:
path: Dockerfile
text: /out/server /usr/local/bin/server
path: Dockerfile
text: CMD ["server"]
Scoring - must not contain: