abitbol/Dockerfile

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"]