2016-04-17 23:48:06 +00:00
|
|
|
FROM alpine:edge
|
|
|
|
|
|
|
|
ENV NOMAD_VERSION v0.3.1
|
|
|
|
|
2016-04-18 17:02:57 +00:00
|
|
|
ADD https://github.com/lalyos/docker-upx/releases/download/v3.91/upx /bin/upx
|
|
|
|
|
2016-04-17 23:48:06 +00:00
|
|
|
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
|
|
|
|
apk update; apk upgrade && \
|
|
|
|
apk add curl make git go gcc musl-dev openssl-dev && \
|
|
|
|
mkdir /go && \
|
|
|
|
export GOPATH=/go && \
|
2016-04-18 17:02:57 +00:00
|
|
|
go get -u -tags ${NOMAD_VERSION} -ldflags -s github.com/hashicorp/nomad && \
|
|
|
|
echo "nomad built" && \
|
|
|
|
chmod +x /bin/upx && for file in /go/bin/* ; do upx -6 $file ; done && \
|
2016-04-17 23:48:06 +00:00
|
|
|
mv /go/bin/* /usr/local/bin && \
|
|
|
|
rm -rf /go && \
|
2016-04-18 17:02:57 +00:00
|
|
|
apk del curl make git go gcc musl-dev openssl-dev && \
|
2016-04-17 23:48:06 +00:00
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
2016-04-18 17:02:57 +00:00
|
|
|
CMD /usr/local/bin/nomad
|