| 1 |
FROM golang:1.24.1-alpine3.21@sha256:43c094ad24b6ac0546c62193baeb3e6e49ce14d3250845d166c77c25f64b0386 AS builder |
| 2 |
|
| 3 |
ARG GOFLAGS="-trimpath -buildvcs=false -buildmode=exe" |
| 4 |
ENV GOFLAGS=$GOFLAGS |
| 5 |
|
| 6 |
# Move to working directory /build |
| 7 |
WORKDIR /build |
| 8 |
|
| 9 |
# Copy and download dependencies using go mod |
| 10 |
COPY go.mod . |
| 11 |
COPY go.sum . |
| 12 |
RUN go mod download |
| 13 |
|
| 14 |
# Copy the code into the container |
| 15 |
COPY . . |
| 16 |
|
| 17 |
# Build the application |
| 18 |
RUN go build -o bin/conformance-aws ./cmd/conformance/aws |
| 19 |
|
| 20 |
# Build release image |
| 21 |
FROM alpine:3.20.2@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5 |
| 22 |
|
| 23 |
COPY --from=builder /build/bin/conformance-aws /bin/conformance-aws |
| 24 |
ENTRYPOINT ["/bin/conformance-aws"] |