# Build stage FROM golang:1.21.4-alpine AS builder WORKDIR /app COPY go.mod ./ # download Go modules and dependencies RUN go mod download # copy all the Go files ending with .go extension COPY *.go ./ RUN go build -o golang-http-header # Final stage FROM scratch COPY --from=builder /app/golang-http-header / # network port at runtime EXPOSE 8000 CMD ["/golang-http-header"]