2018-10-13 08:54:39 +02:00
|
|
|
FROM golang:1.10-alpine as builder
|
|
|
|
MAINTAINER Jessica Frazelle <jess@linux.com>
|
|
|
|
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
libgcc \
|
2018-11-04 02:51:56 +01:00
|
|
|
linux-headers \
|
2018-10-13 08:54:39 +02:00
|
|
|
make \
|
|
|
|
musl-dev \
|
|
|
|
npm \
|
|
|
|
pkgconf \
|
2018-12-18 17:39:08 +01:00
|
|
|
python2 \
|
2018-10-13 08:54:39 +02:00
|
|
|
yarn \
|
|
|
|
zip
|
|
|
|
|
2019-03-08 16:31:44 +01:00
|
|
|
ENV NOMAD_VERSION v0.9.0-beta3
|
2018-10-13 08:54:39 +02:00
|
|
|
|
|
|
|
RUN go get github.com/hashicorp/nomad
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/hashicorp/nomad
|
|
|
|
|
|
|
|
RUN git checkout "${NOMAD_VERSION}"
|
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& make bootstrap ember-dist static-assets \
|
|
|
|
&& CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
|
|
|
|
go build \
|
|
|
|
-ldflags "-X github.com/hashicorp/nomad/version.GitCommit=$(git rev-parse HEAD) -extldflags -static " \
|
|
|
|
-tags "ui release" \
|
|
|
|
-o /usr/bin/nomad
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
COPY --from=builder /usr/bin/nomad /usr/bin/nomad
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
|
|
|
|
|
|
|
ENTRYPOINT [ "nomad" ]
|
|
|
|
CMD [ "--help" ]
|