2015-12-28 21:31:47 +01:00
|
|
|
FROM alpine
|
2015-01-27 12:05:21 +01:00
|
|
|
MAINTAINER Jessica Frazelle <jess@docker.com>
|
|
|
|
|
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
|
|
|
|
|
|
|
RUN apk update && apk add \
|
2015-03-17 02:44:11 +01:00
|
|
|
ca-certificates \
|
|
|
|
curl \
|
2015-07-28 08:46:07 +02:00
|
|
|
&& rm -rf /var/cache/apk/*
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2016-03-22 19:34:34 +01:00
|
|
|
ENV CONSUL_VERSION v0.6.3
|
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 \
|
|
|
|
&& apk update \
|
|
|
|
&& apk add $buildDeps \
|
|
|
|
&& 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 /var/cache/apk/* \
|
|
|
|
&& 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" ]
|