Files
beelzebub/Dockerfile

30 lines
430 B
Docker
Raw Normal View History

2022-05-08 20:49:53 +02:00
FROM golang:alpine AS builder
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux
2022-05-08 20:49:53 +02:00
RUN apk add git
WORKDIR /build
# Download dependency
COPY . .
2022-05-08 20:49:53 +02:00
RUN go mod download
# Build
2022-05-08 20:49:53 +02:00
RUN go build -o main .
WORKDIR /dist
RUN cp /build/main .
# Use scratch image as finally tiny container
2022-05-08 20:49:53 +02:00
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2022-05-08 20:49:53 +02:00
COPY --from=builder /dist/main /
ENTRYPOINT ["/main"]