20 lines
303 B
Text
20 lines
303 B
Text
|
FROM golang:latest as builder
|
||
|
|
||
|
ARG GO_CMD=funbot
|
||
|
ENV CGO_ENABLED=0 \
|
||
|
GOARCH=amd64 \
|
||
|
GOOS=linux
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
ADD . /app/
|
||
|
|
||
|
RUN go build -ldflags "-s -w -extldflags '-static'" -o /main ./cmd/${GO_CMD}/
|
||
|
|
||
|
FROM scratch
|
||
|
COPY --chown=65534:0 --from=builder /main /
|
||
|
|
||
|
USER 65534
|
||
|
WORKDIR /
|
||
|
|
||
|
CMD ["/main"]
|