2016-10-07 19:03:54 -07:00
|
|
|
FROM alpine:latest
|
2016-09-19 15:25:05 -07:00
|
|
|
MAINTAINER Jessie Frazelle <jess@linux.com>
|
2015-01-27 03:05:21 -08:00
|
|
|
|
2015-12-28 12:31:47 -08:00
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
2016-03-22 11:34:34 -07:00
|
|
|
#ENV GO15VENDOREXPERIMENT 1
|
2015-12-28 12:31:47 -08:00
|
|
|
|
2016-06-06 05:40:20 +02:00
|
|
|
RUN apk --no-cache add \
|
2015-03-16 18:44:11 -07:00
|
|
|
ca-certificates \
|
2016-06-06 05:40:20 +02:00
|
|
|
curl
|
2015-06-09 13:44:12 -07:00
|
|
|
|
2017-02-26 15:42:03 -08:00
|
|
|
ENV CONSUL_VERSION v0.7.5
|
2015-12-28 12:31:47 -08:00
|
|
|
|
|
|
|
RUN buildDeps=' \
|
|
|
|
bash \
|
|
|
|
go \
|
|
|
|
git \
|
|
|
|
gcc \
|
2015-12-28 14:45:03 -08:00
|
|
|
g++ \
|
2015-12-28 12:31:47 -08:00
|
|
|
libc-dev \
|
|
|
|
libgcc \
|
|
|
|
make \
|
2015-12-28 14:45:03 -08:00
|
|
|
nodejs \
|
|
|
|
ruby \
|
|
|
|
ruby-dev \
|
2015-12-28 12:31:47 -08:00
|
|
|
zip \
|
|
|
|
' \
|
|
|
|
set -x \
|
2016-12-02 13:42:52 -08:00
|
|
|
&& apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $buildDeps \
|
2015-12-28 12:31:47 -08: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 \
|
2016-12-27 17:04:58 -08:00
|
|
|
&& git clone --depth 1 --branch ${CONSUL_VERSION} https://github.com/hashicorp/consul /go/src/github.com/hashicorp/consul \
|
2015-12-28 12:31:47 -08:00
|
|
|
&& cd /go/src/github.com/hashicorp/consul \
|
2016-03-22 11:34:34 -07:00
|
|
|
&& XC_ARCH="amd64" XC_OS="linux" make all \
|
2015-12-28 12:31:47 -08:00
|
|
|
&& mv bin/consul /usr/bin/ \
|
|
|
|
&& cd ui \
|
2015-12-28 14:45:03 -08:00
|
|
|
&& gem install bundler io-console --no-ri --no-rdoc \
|
|
|
|
&& bundle install \
|
2015-12-28 12:31:47 -08:00
|
|
|
&& make dist \
|
2015-12-28 15:20:42 -08:00
|
|
|
&& mkdir -p /usr/src/consul \
|
|
|
|
&& mv index.html /usr/src/consul \
|
2015-12-28 16:37:27 -08:00
|
|
|
&& mv static /usr/src/consul/ \
|
|
|
|
&& mv javascripts /usr/src/consul/ \
|
2015-12-28 12:31:47 -08:00
|
|
|
&& apk del $buildDeps \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& echo "Build complete."
|
2015-06-09 13:44:12 -07:00
|
|
|
|
2015-01-27 03:05:21 -08:00
|
|
|
|
2015-12-28 12:31:47 -08:00
|
|
|
ENTRYPOINT [ "consul" ]
|