2021-08-20 15:28:10 +00:00
|
|
|
FROM golang:1.17.0-alpine3.14 as builder
|
|
|
|
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
|
2021-11-20 15:05:58 +00:00
|
|
|
|
2021-08-20 15:28:10 +00:00
|
|
|
RUN apk update && apk add --no-cache ca-certificates && update-ca-certificates
|
2021-11-20 15:05:58 +00:00
|
|
|
|
2021-08-20 15:28:10 +00:00
|
|
|
WORKDIR /opt
|
2021-11-20 14:10:21 +00:00
|
|
|
COPY . /opt/
|
2021-08-20 15:28:10 +00:00
|
|
|
RUN go build .
|
|
|
|
|
2021-11-20 15:05:58 +00:00
|
|
|
#-----------#
|
2021-08-20 15:28:10 +00:00
|
|
|
FROM scratch
|
2021-11-20 15:05:58 +00:00
|
|
|
WORKDIR /
|
2021-08-20 15:28:10 +00:00
|
|
|
COPY --from=builder /opt/bagage /
|
2021-11-20 15:05:58 +00:00
|
|
|
COPY --chown=1000:1000 --from=builder /mnt /s3_cache
|
2021-08-20 15:28:10 +00:00
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
USER 1000:1000
|
|
|
|
ENTRYPOINT ["/bagage"]
|