diff --git a/consul-alerts/Dockerfile b/consul-alerts/Dockerfile index 083f093..fc89e25 100644 --- a/consul-alerts/Dockerfile +++ b/consul-alerts/Dockerfile @@ -1,26 +1,25 @@ -FROM alpine:latest +FROM jess/consul MAINTAINER Jessica Frazelle -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" ] diff --git a/consul/Dockerfile b/consul/Dockerfile index b69595a..a5c4771 100644 --- a/consul/Dockerfile +++ b/consul/Dockerfile @@ -1,28 +1,43 @@ -FROM alpine:latest +FROM alpine MAINTAINER Jessica Frazelle -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" ]