Last active
September 12, 2017 21:01
-
-
Save 0xAhmed/8dbbf5b1e8e7fc1215f3b7779350fcc0 to your computer and use it in GitHub Desktop.
Using Docker build arguments and multi-stage builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:latest as builder | |
| # If RELEASE is not passed as a build arg, go with master | |
| ARG RELEASE=master | |
| WORKDIR /go | |
| ENV GOBIN $GOPATH/bin | |
| RUN echo "Using Hacher ${RELEASE}" \ | |
| && wget -q https://github.com/Dockbit/hacher/archive/${RELEASE}.tar.gz -O hacher-${RELEASE}.tar.gz \ | |
| && tar xf hacher-${RELEASE}.tar.gz \ | |
| && cd hacher-* \ | |
| && make install && make build | |
| FROM alpine:latest | |
| COPY --from=0 /go/bin/hacher-* /hacher | |
| ENTRYPOINT ["/hacher"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment