diff --git a/Dockerfile b/Dockerfile index e2d3560..b9e625e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,22 @@ FROM golang:1.8 MAINTAINER Sevki -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