Buildfile for a clean docker image

This commit is contained in:
Pascal Dulieu 2019-02-22 18:46:03 +00:00
parent 8b9d8bfd17
commit 23c5c6679e
2 changed files with 3905 additions and 9 deletions

View File

@ -1,10 +1,11 @@
FROM golang:1.11.5 AS builder
ADD . /src
RUN cd /src \
&& go test . \
&& go build -o binary
FROM golang:alpine as builder
RUN apk add git && \
go get -d -v github.com/terorie/od-database-crawler
WORKDIR /go/src/github.com/terorie/od-database-crawler
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/od-database-crawler .
FROM alpine
WORKDIR /app
COPY --from=builder /src/binary /app/
ENTRYPOINT [ "/app/binary", "server" ]
FROM scratch
COPY script/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/od-database-crawler /go/
VOLUME [ "/go" ]
CMD ["/go/od-database-crawler", "server"]

3895
script/ca-certificates.crt Normal file

File diff suppressed because it is too large Load Diff