switch to chainguard images

This commit is contained in:
Seraphim Strub 2024-02-12 17:03:15 +00:00
parent 4e3e775dc5
commit 1c2c1b311b
3 changed files with 7 additions and 13 deletions

19
Containerfile Normal file
View file

@ -0,0 +1,19 @@
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"]