2024-02-12 17:03:15 +00:00
|
|
|
FROM cgr.dev/chainguard/go:latest as build
|
2023-01-26 21:06:58 +00:00
|
|
|
|
|
|
|
ARG GO_CMD=funbot
|
|
|
|
ENV CGO_ENABLED=0 \
|
|
|
|
GOARCH=amd64 \
|
|
|
|
GOOS=linux
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
ADD . /app/
|
|
|
|
|
2023-04-22 23:05:35 +00:00
|
|
|
RUN go build -ldflags "-X main.release=$(git rev-parse --short HEAD) -s -w -extldflags '-static'" -o /main ./cmd/${GO_CMD}/
|
2023-01-26 21:06:58 +00:00
|
|
|
|
2024-02-12 17:03:15 +00:00
|
|
|
FROM cgr.dev/chainguard/static:latest
|
|
|
|
COPY --chown=65534:0 --from=build /main /
|
2023-01-26 21:06:58 +00:00
|
|
|
USER 65534
|
|
|
|
WORKDIR /
|
|
|
|
|
2024-02-12 17:03:15 +00:00
|
|
|
CMD ["/main"]
|