0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-30 22:34:18 -05:00

dockerfile: use scratch image to reduce size

Fixes #113
This commit is contained in:
matematik7 2017-09-10 19:00:23 +02:00 committed by Will Norris
parent 37c9f4d6ab
commit 837e72352f

View file

@ -1,10 +1,22 @@
FROM golang:1.8
MAINTAINER Sevki <s@sevki.org>
ADD . /go/src/willnorris.com/go/imageproxy
RUN go get willnorris.com/go/imageproxy/cmd/imageproxy
WORKDIR /go/src/willnorris.com/go/imageproxy
ADD . .
CMD []
WORKDIR /go/src/willnorris.com/go/imageproxy/cmd/imageproxy
RUN go-wrapper download
RUN CGO_ENABLED=0 GOOS=linux go-wrapper install
FROM scratch
WORKDIR /go/bin
COPY --from=0 /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=0 /etc/ssl/certs /etc/ssl/certs
COPY --from=0 /go/bin/imageproxy .
CMD ["-addr", "0.0.0.0:8080"]
ENTRYPOINT ["/go/bin/imageproxy"]
EXPOSE 8080