update consul dockerfile

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
Jessica Frazelle 2015-12-28 12:31:47 -08:00
parent a6a10b92f3
commit bd9cdb6ff1
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
2 changed files with 55 additions and 41 deletions

View File

@ -1,26 +1,25 @@
FROM alpine:latest FROM jess/consul
MAINTAINER Jessica Frazelle <jess@docker.com> MAINTAINER Jessica Frazelle <jess@docker.com>
RUN apk update && apk add \ ENV PATH /go/bin:/usr/local/go/bin:$PATH
ca-certificates \ ENV GOPATH /go
curl \
unzip \
&& curl -sSL https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk -o /tmp/glibc-2.21-r2.apk \
&& apk add --allow-untrusted /tmp/glibc-2.21-r2.apk \
&& curl -sSL https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk -o /tmp/glibc-bin-2.21-r2.apk \
&& apk add --allow-untrusted /tmp/glibc-bin-2.21-r2.apk \
&& rm -rf /tmp/glibc* \
&& rm -rf /var/cache/apk/*
ENV CONSUL_VERSION 0.5.2 RUN buildDeps=' \
go \
git \
gcc \
libc-dev \
libgcc \
' \
set -x \
&& apk update \
&& apk add $buildDeps \
&& go get github.com/AcalephStorage/consul-alerts \
&& mv /go/bin/consul-alerts /usr/bin/ \
&& apk del $buildDeps \
&& rm -rf /var/cache/apk/* \
&& rm -rf /go \
&& echo "Build complete."
RUN curl -sSL https://jesss.s3.amazonaws.com/binaries/consul/${CONSUL_VERSION}/consul -o /bin/consul \
&& curl -sSL https://jesss.s3.amazonaws.com/binaries/curl-unix-socket -o /bin/curl-unix-socket \
&& curl -sSL https://jesss.s3.amazonaws.com/binaries/consul-alerts -o /bin/consul-alerts \
&& mkdir -p /etc/consul.d/ \
&& chmod +x /bin/consul \
&& chmod +x /bin/curl-unix-socket \
&& chmod +x /bin/consul-alerts
ENTRYPOINT [ "/bin/consul-alerts" ] ENTRYPOINT [ "consul-alerts" ]
CMD [ "start" ]

View File

@ -1,28 +1,43 @@
FROM alpine:latest FROM alpine
MAINTAINER Jessica Frazelle <jess@docker.com> MAINTAINER Jessica Frazelle <jess@docker.com>
RUN apk update && apk add \ ENV PATH /go/bin:/usr/local/go/bin:$PATH
ENV GOPATH /go
RUN apk update && apk add \
ca-certificates \ ca-certificates \
curl \ curl \
unzip \
&& curl -sSL https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk -o /tmp/glibc-2.21-r2.apk \
&& apk add --allow-untrusted /tmp/glibc-2.21-r2.apk \
&& curl -sSL https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk -o /tmp/glibc-bin-2.21-r2.apk \
&& apk add --allow-untrusted /tmp/glibc-bin-2.21-r2.apk \
&& rm -rf /tmp/glibc* \
&& rm -rf /var/cache/apk/* && rm -rf /var/cache/apk/*
ENV CONSUL_VERSION 0.5.2 ENV CONSUL_VERSION v0.6.0
RUN curl -sSL https://jesss.s3.amazonaws.com/binaries/consul/${CONSUL_VERSION}/consul -o /bin/consul \ RUN buildDeps=' \
&& curl -sSL https://jesss.s3.amazonaws.com/binaries/curl-unix-socket -o /bin/curl-unix-socket \ bash \
&& curl -sSL https://jesss.s3.amazonaws.com/binaries/consul/${CONSUL_VERSION}/ui.zip -o /tmp/ui.zip \ go \
&& unzip /tmp/ui.zip -d /usr/src/ \ git \
&& rm -rf /tmp/ui.zip \ gcc \
&& mv /usr/src/dist /usr/src/consul \ libc-dev \
&& mkdir -p /etc/consul.d/ \ libgcc \
&& chmod +x /bin/consul \ make \
&& chmod +x /bin/curl-unix-socket \ zip \
&& /usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib ' \
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 [ "/bin/consul" ]
ENTRYPOINT [ "consul" ]