2016-10-08 04:03:54 +02:00
|
|
|
FROM alpine:latest
|
2017-03-09 19:14:37 +01:00
|
|
|
LABEL 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 \
|
2017-03-22 20:29:18 +01:00
|
|
|
ca-certificates
|
2015-06-09 22:44:12 +02:00
|
|
|
|
2017-04-27 23:06:24 +02:00
|
|
|
ENV CONSUL_VERSION v0.8.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-12-02 22:42:52 +01:00
|
|
|
&& apk --no-cache add --repository https://dl-3.alpinelinux.org/alpine/edge/community $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 \
|
2016-12-28 02:04:58 +01:00
|
|
|
&& git clone --depth 1 --branch ${CONSUL_VERSION} https://github.com/hashicorp/consul /go/src/github.com/hashicorp/consul \
|
2015-12-28 21:31:47 +01:00
|
|
|
&& 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" ]
|