Skip to content

Instantly share code, notes, and snippets.

@0xAhmed
Last active September 12, 2017 21:01
Show Gist options
  • Select an option

  • Save 0xAhmed/8dbbf5b1e8e7fc1215f3b7779350fcc0 to your computer and use it in GitHub Desktop.

Select an option

Save 0xAhmed/8dbbf5b1e8e7fc1215f3b7779350fcc0 to your computer and use it in GitHub Desktop.
Using Docker build arguments and multi-stage builds
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