Skip to content

Commit

Permalink
Use multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilder committed Jun 13, 2017
1 parent 6a43782 commit 041ba57
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM alpine:latest
MAINTAINER Jason Wilder <mail@jasonwilder.com>
FROM golang:1.8.3-alpine3.6 AS binary
RUN apk -U add openssl git

ADD . /go/src/github.com/jwilder/dockerize
WORKDIR /go/src/github.com/jwilder/dockerize

RUN apk -U add openssl
RUN go get github.com/robfig/glock
RUN glock sync -n < GLOCKFILE
RUN go install

ENV VERSION v0.4.0
ENV DOWNLOAD_URL https://github.com/jwilder/dockerize/releases/download/$VERSION/dockerize-alpine-linux-amd64-$VERSION.tar.gz
FROM alpine:3.6
MAINTAINER Jason Wilder <mail@jasonwilder.com>

RUN wget -qO- $DOWNLOAD_URL | tar xvz -C /usr/local/bin
COPY --from=binary /go/bin/dockerize /usr/local/bin

ENTRYPOINT ["dockerize"]
CMD ["--help"]

0 comments on commit 041ba57

Please sign in to comment.