2019-09-16 23:00:18 +02:00
|
|
|
FROM golang:1.12 as builder
|
2018-07-06 18:08:45 +02:00
|
|
|
MAINTAINER Jessica Frazelle <jess@linux.com>
|
2015-01-27 12:05:21 +01:00
|
|
|
|
2015-12-28 21:31:47 +01:00
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
2018-07-06 18:08:45 +02:00
|
|
|
RUN apt-get update && apt-get install -y \
|
2019-05-25 23:23:46 +02:00
|
|
|
apt-transport-https \
|
2018-07-06 18:08:45 +02:00
|
|
|
ca-certificates \
|
2019-05-25 23:23:46 +02:00
|
|
|
curl \
|
2018-07-06 18:08:45 +02:00
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
ruby-dev \
|
|
|
|
ruby \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2019-05-25 23:23:46 +02:00
|
|
|
# Add yarn to apt repos.
|
|
|
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
|
|
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
|
|
|
|
|
|
|
# Setup node install.
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
nodejs \
|
|
|
|
yarn \
|
|
|
|
--no-install-recommends \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2019-09-16 23:00:18 +02:00
|
|
|
ENV CONSUL_VERSION v1.6.1
|
2015-12-28 21:31:47 +01:00
|
|
|
|
2019-09-16 23:00:18 +02:00
|
|
|
RUN go get github.com/hashicorp/consul || true
|
2018-07-06 18:08:45 +02:00
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/hashicorp/consul
|
|
|
|
|
|
|
|
RUN git checkout "${CONSUL_VERSION}"
|
|
|
|
|
|
|
|
# Install deps for UI.
|
|
|
|
RUN gem install \
|
|
|
|
bundler \
|
|
|
|
--no-ri --no-rdoc
|
|
|
|
|
2019-05-25 23:23:46 +02:00
|
|
|
RUN cd ui-v2 \
|
|
|
|
&& yarn install \
|
2019-05-25 23:41:09 +02:00
|
|
|
&& make \
|
|
|
|
&& rm -rf ../pkg/web_ui \
|
|
|
|
&& mkdir -p ../pkg \
|
|
|
|
&& cp -r dist ../pkg/web_ui
|
2018-07-06 18:08:45 +02:00
|
|
|
|
|
|
|
RUN TERM=xterm XC_ARCH="amd64" XC_OS="linux" LD_FLAGS=" -extldflags -static" make tools static-assets bin \
|
|
|
|
&& mv bin/consul /usr/bin/consul
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2018-07-06 18:08:45 +02:00
|
|
|
COPY --from=builder /usr/bin/consul /usr/bin/consul
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
2015-01-27 12:05:21 +01:00
|
|
|
|
2015-12-28 21:31:47 +01:00
|
|
|
ENTRYPOINT [ "consul" ]
|
2018-07-06 18:08:45 +02:00
|
|
|
CMD [ "--help" ]
|