mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 19:32:30 +01:00
bd9cdb6ff1
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
44 lines
907 B
Docker
44 lines
907 B
Docker
FROM alpine
|
|
MAINTAINER Jessica Frazelle <jess@docker.com>
|
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
ENV GOPATH /go
|
|
|
|
RUN apk update && apk add \
|
|
ca-certificates \
|
|
curl \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
ENV CONSUL_VERSION v0.6.0
|
|
|
|
RUN buildDeps=' \
|
|
bash \
|
|
go \
|
|
git \
|
|
gcc \
|
|
libc-dev \
|
|
libgcc \
|
|
make \
|
|
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 \
|
|
&& make all \
|
|
&& mv bin/consul /usr/bin/ \
|
|
&& cd ui \
|
|
&& make dist \
|
|
&& mv dist /usr/src/ \
|
|
&& apk del $buildDeps \
|
|
&& rm -rf /var/cache/apk/* \
|
|
&& rm -rf /go \
|
|
&& echo "Build complete."
|
|
|
|
|
|
ENTRYPOINT [ "consul" ]
|