mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-23 11:31:49 +01:00
update consul dockerfile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
parent
a6a10b92f3
commit
bd9cdb6ff1
|
@ -1,26 +1,25 @@
|
|||
FROM alpine:latest
|
||||
FROM jess/consul
|
||||
MAINTAINER Jessica Frazelle <jess@docker.com>
|
||||
|
||||
RUN apk update && apk add \
|
||||
ca-certificates \
|
||||
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 PATH /go/bin:/usr/local/go/bin:$PATH
|
||||
ENV GOPATH /go
|
||||
|
||||
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" ]
|
||||
CMD [ "start" ]
|
||||
ENTRYPOINT [ "consul-alerts" ]
|
||||
|
|
|
@ -1,28 +1,43 @@
|
|||
FROM alpine:latest
|
||||
FROM alpine
|
||||
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 \
|
||||
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
|
||||
ENV CONSUL_VERSION v0.6.0
|
||||
|
||||
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/${CONSUL_VERSION}/ui.zip -o /tmp/ui.zip \
|
||||
&& unzip /tmp/ui.zip -d /usr/src/ \
|
||||
&& rm -rf /tmp/ui.zip \
|
||||
&& mv /usr/src/dist /usr/src/consul \
|
||||
&& mkdir -p /etc/consul.d/ \
|
||||
&& chmod +x /bin/consul \
|
||||
&& chmod +x /bin/curl-unix-socket \
|
||||
&& /usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib
|
||||
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 [ "/bin/consul" ]
|
||||
|
||||
ENTRYPOINT [ "consul" ]
|
||||
|
|
Loading…
Reference in New Issue
Block a user