mlpcardbot/Dockerfile

20 lines
339 B
Text
Raw Permalink Normal View History

2019-08-26 10:39:30 +00:00
FROM golang:alpine AS builder
ENV GOPROXY https://modules.fromouter.space
ENV GO111MODULE=on
WORKDIR /app
# Get updated modules
COPY ./ ./
RUN go mod download
# Compile code
RUN CGO_ENABLED=0 go build -o /svc .
FROM scratch AS final
# Import the compiled executable from the first stage.
COPY --from=builder /svc /svc
CMD [ "/svc" ]