discordBots/Containerfile
2024-02-12 17:05:56 +00:00

19 lines
385 B
Docker

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"]