abitbol/Dockerfile
Bartuccio Antoine 92dade1312
All checks were successful
continuous-integration/drone/push Build is passing
Peter il a la méga chiasse
2020-05-18 21:32:17 +02:00

22 lines
466 B
Docker

FROM golang:1.14 AS builder
RUN mkdir /build
WORKDIR /build
# Copy the code from the host and compile it
COPY . .
RUN mkdir res
COPY quotes.json res/quotes.json
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .
FROM scratch
# We need ca-certifactes for http calls
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app ./
COPY --from=builder /build/res ./
ENTRYPOINT ["./app"]