FROM cgr.dev/chainguard/go:latest as build ARG GO_CMD=funbot ENV CGO_ENABLED=0 \ GOARCH=amd64 \ GOOS=linux WORKDIR /app ADD . /app/ RUN go build -ldflags "-X main.release=$(git rev-parse --short HEAD) -s -w -extldflags '-static'" -o /main ./cmd/${GO_CMD}/ FROM cgr.dev/chainguard/static:latest COPY --chown=65534:0 --from=build /main / USER 65534 WORKDIR / CMD ["/main"]