Skip to content

Commit

Permalink
Upgrade Consul to 0.7 and ContainerPilot to 2.4.1
Browse files Browse the repository at this point in the history
- Also ensure that we checksum Consul downloads during the build.
- Improve tagging in makefile
  • Loading branch information
tgross authored Sep 19, 2016
1 parent b806bb0 commit 28cf6dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
49 changes: 27 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.3
FROM alpine:3.4

# Alpine packages
RUN apk --no-cache \
Expand All @@ -8,36 +8,41 @@ RUN apk --no-cache \
ca-certificates

# The Consul binary
ENV CONSUL_VERSION=0.6.4
RUN curl -Lo /tmp/consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip && \
cd /bin && \
unzip /tmp/consul.zip && \
chmod +x /bin/consul && \
rm /tmp/consul.zip
ENV CONSUL_VERSION=0.7.0
RUN export CONSUL_CHECKSUM=b350591af10d7d23514ebaa0565638539900cdb3aaa048f077217c4c46653dd8 \
&& export archive=consul_${CONSUL_VERSION}_linux_amd64.zip \
&& curl -Lso /tmp/${archive} https://releases.hashicorp.com/consul/${CONSUL_VERSION}/${archive} \
&& echo "${CONSUL_CHECKSUM} /tmp/${archive}" | sha256sum -c \
&& cd /bin \
&& unzip /tmp/${archive} \
&& chmod +x /bin/consul \
&& rm /tmp/${archive}

# The Consul web UI
RUN curl -Lo /tmp/webui.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_web_ui.zip && \
mkdir /ui && \
cd /ui && \
unzip /tmp/webui.zip && \
rm /tmp/webui.zip
RUN export CONSUL_UI_CHECKSUM=42212089c228a73a0881a5835079c8df58a4f31b5060a3b4ffd4c2497abe3aa8 \
&& export archive=consul_${CONSUL_VERSION}_web_ui.zip \
&& curl -Lso /tmp/${archive} https://releases.hashicorp.com/consul/${CONSUL_VERSION}/${archive} \
&& echo "${CONSUL_UI_CHECKSUM} /tmp/${archive}" | sha256sum -c \
&& mkdir /ui \
&& cd /ui \
&& unzip /tmp/${archive} \
&& rm /tmp/${archive}

# Add Containerpilot and set its configuration
ENV CONTAINERPILOT_VERSION 2.3.0
ENV CONTAINERPILOT_VERSION 2.4.1
ENV CONTAINERPILOT file:///etc/containerpilot.json

RUN export CONTAINERPILOT_CHECKSUM=ec9dbedaca9f4a7a50762f50768cbc42879c7208 \
&& curl -Lso /tmp/containerpilot.tar.gz \
"https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/containerpilot-${CONTAINERPILOT_VERSION}.tar.gz" \
&& echo "${CONTAINERPILOT_CHECKSUM} /tmp/containerpilot.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerpilot.tar.gz -C /usr/local/bin \
&& rm /tmp/containerpilot.tar.gz
RUN export CONTAINERPILOT_CHECKSUM=198d96c8d7bfafb1ab6df96653c29701510b833c \
&& export archive=containerpilot-${CONTAINERPILOT_VERSION}.tar.gz \
&& curl -Lso /tmp/${archive} \
"https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VERSION}/${archive}" \
&& echo "${CONTAINERPILOT_CHECKSUM} /tmp/${archive}" | sha1sum -c \
&& tar zxf /tmp/${archive} -C /usr/local/bin \
&& rm /tmp/${archive}

# Consul config
# configuration files and bootstrap scripts
COPY etc/containerpilot.json etc/
COPY etc/consul.json etc/consul/

# copy bootstrap scripts
COPY bin/* /usr/local/bin/

# Put Consul data on a separate volume to avoid filesystem performance issues
Expand Down
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ build:

# push our image to the public registry
ship:
docker tag autopilotpattern/consul:${TAG} autopilotpattern/consul:latest
docker push "autopilotpattern/consul:${TAG}"
docker push "autopilotpattern/consul:latest"

0 comments on commit 28cf6dd

Please sign in to comment.