2016-10-08 04:03:54 +02:00
|
|
|
FROM alpine:latest
|
2016-09-20 00:25:05 +02:00
|
|
|
MAINTAINER Jessie 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
|
2016-03-22 19:34:34 +01:00
|
|
|
#ENV GO15VENDOREXPERIMENT 1
|
2015-12-28 21:31:47 +01:00
|
|
|
|
2016-06-06 05:40:20 +02:00
|
|
|
RUN apk --no-cache add \
|
2015-03-17 02:44:11 +01:00
|
|
|
ca-certificates \
|
2016-06-06 05:40:20 +02:00
|
|
|
curl
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2016-12-02 21:08:26 +01:00
|
|
|
ENV CONSUL_VERSION v0.7.1
|
2015-12-28 21:31:47 +01:00
|
|
|
|
|
|
|
RUN buildDeps=' \
|
|
|
|
bash \
|
|
|
|
go \
|
|
|
|
git \
|
|
|
|
gcc \
|
2015-12-28 23:45:03 +01:00
|
|
|
g++ \
|
2015-12-28 21:31:47 +01:00
|
|
|
libc-dev \
|
|
|
|
libgcc \
|
|
|
|
make \
|
2015-12-28 23:45:03 +01:00
|
|
|
nodejs \
|
|
|
|
ruby \
|
|
|
|
ruby-dev \
|
2015-12-28 21:31:47 +01:00
|
|
|
zip \
|
|
|
|
' \
|
|
|
|
set -x \
|
2016-06-06 05:40:20 +02:00
|
|
|
&& apk --no-cache add $buildDeps \
|
2015-12-28 21:31:47 +01:00
|
|
|
&& go get github.com/Soulou/curl-unix-socket \
|
|
|
|
&& mv /go/bin/curl-unix-socket /usr/bin/ \
|
|
|
|
&& mkdir -p /go/src/github.com/hashicorp /etc/consul.d \
|
|
|
|
&& git clone --branch ${CONSUL_VERSION} https://github.com/hashicorp/consul /go/src/github.com/hashicorp/consul \
|
|
|
|
&& cd /go/src/github.com/hashicorp/consul \
|
2016-03-22 19:34:34 +01:00
|
|
|
&& XC_ARCH="amd64" XC_OS="linux" make all \
|
2015-12-28 21:31:47 +01:00
|
|
|
&& mv bin/consul /usr/bin/ \
|
|
|
|
&& cd ui \
|
2015-12-28 23:45:03 +01:00
|
|
|
&& gem install bundler io-console --no-ri --no-rdoc \
|
|
|
|
&& bundle install \
|
2015-12-28 21:31:47 +01:00
|
|
|
&& make dist \
|
2015-12-29 00:20:42 +01:00
|
|
|
&& mkdir -p /usr/src/consul \
|
|
|
|
&& mv index.html /usr/src/consul \
|
2015-12-29 01:37:27 +01:00
|
|
|
&& mv static /usr/src/consul/ \
|
|
|
|
&& mv javascripts /usr/src/consul/ \
|
2015-12-28 21:31:47 +01:00
|
|
|
&& apk del $buildDeps \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& echo "Build complete."
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2015-01-27 12:05:21 +01:00
|
|
|
|
2015-12-28 21:31:47 +01:00
|
|
|
ENTRYPOINT [ "consul" ]
|