FROM golang:1.21.5-alpine3.17 as builder RUN apk add git WORKDIR /go/src/gitlab.eclipse.org/eclipse/xfsc/tsa/cache ARG APP_VER ADD . . RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=$APP_VER" -mod=vendor -o /tmp/cache ./cmd/cache/... FROM alpine:3.17 as runner COPY --from=builder /tmp/cache /opt/cache WORKDIR /opt CMD ["./cache"]