|
1 |
| -FROM memcached:latest |
| 1 | +FROM memcached:1.4-alpine |
2 | 2 |
|
| 3 | +# Build-time metadata as defined at http://label-schema.org |
| 4 | +# with added usage described in https://microbadger.com/#/labels |
| 5 | +ARG BUILD_DATE |
| 6 | +ARG VCS_REF |
| 7 | +LABEL org.label-schema.build-date=$BUILD_DATE \ |
| 8 | + org.label-schema.docker.dockerfile="/Dockerfile" \ |
| 9 | + org.label-schema.name="Autopilot Pattern Memcached" \ |
| 10 | + org.label-schema.url="https://github.com/autopilotpattern/memcached" \ |
| 11 | + org.label-schema.vcs-ref=$VCS_REF \ |
| 12 | + org.label-schema.vcs-type="Git" \ |
| 13 | + org.label-schema.vcs-url="https://github.com/autopilotpattern/memcached" |
| 14 | + |
| 15 | +# Reset to root user to do some installs |
3 | 16 | USER root
|
4 |
| -RUN apt-get update \ |
5 |
| - && apt-get install -y \ |
6 |
| - netcat \ |
7 |
| - curl |
8 | 17 |
|
9 |
| -# Install ContainerPilot |
| 18 | +# Install packages |
| 19 | +RUN apk update && apk add \ |
| 20 | + bash \ |
| 21 | + curl \ |
| 22 | + netcat-openbsd \ |
| 23 | + && rm -rf /var/cache/apk/* |
| 24 | + |
| 25 | +# Add ContainerPilot and its configuration |
10 | 26 | # Releases at https://github.com/joyent/containerpilot/releases
|
11 |
| -ENV CONTAINERPILOT_VER 2.0.1 |
12 |
| -RUN export CONTAINERPILOT_CHECKSUM=a4dd6bc001c82210b5c33ec2aa82d7ce83245154 \ |
13 |
| - && curl -Lso /tmp/containerpilot.tar.gz \ |
14 |
| - "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VER}/containerpilot-${CONTAINERPILOT_VER}.tar.gz" \ |
| 27 | +ENV CONTAINERPILOT_VER 2.3.0 |
| 28 | +ENV CONTAINERPILOT file:///etc/containerpilot.json |
| 29 | + |
| 30 | +RUN export CONTAINERPILOT_CHECKSUM=ec9dbedaca9f4a7a50762f50768cbc42879c7208 \ |
| 31 | + && curl --retry 7 --fail -Lso /tmp/containerpilot.tar.gz \ |
| 32 | + "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VER}/containerpilot-${CONTAINERPILOT_VER}.tar.gz" \ |
15 | 33 | && echo "${CONTAINERPILOT_CHECKSUM} /tmp/containerpilot.tar.gz" | sha1sum -c \
|
16 | 34 | && tar zxf /tmp/containerpilot.tar.gz -C /usr/local/bin \
|
17 | 35 | && rm /tmp/containerpilot.tar.gz
|
18 | 36 |
|
19 |
| -# Add ContainerPilot configuration |
20 |
| -COPY etc/containerpilot.json /etc/containerpilot.json |
21 |
| -ENV CONTAINERPILOT file:///etc/containerpilot.json |
| 37 | +# The our helper/glue scripts and configuration for this specific app |
| 38 | +COPY bin /usr/local/bin |
| 39 | +COPY etc /etc |
| 40 | + |
| 41 | +# Install Consul |
| 42 | +# Releases at https://releases.hashicorp.com/consul |
| 43 | +RUN export CONSUL_VERSION=0.6.4 \ |
| 44 | + && export CONSUL_CHECKSUM=abdf0e1856292468e2c9971420d73b805e93888e006c76324ae39416edcf0627 \ |
| 45 | + && curl --retry 7 --fail -vo /tmp/consul.zip "https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip" \ |
| 46 | + && echo "${CONSUL_CHECKSUM} /tmp/consul.zip" | sha256sum -c \ |
| 47 | + && unzip /tmp/consul -d /usr/local/bin \ |
| 48 | + && rm /tmp/consul.zip \ |
| 49 | + && mkdir /config |
22 | 50 |
|
23 |
| -# reset entrypoint from base image |
| 51 | +# Create empty directories for Consul config and data |
| 52 | +RUN mkdir -p /etc/consul \ |
| 53 | + && chown -R memcache /etc/consul \ |
| 54 | + && mkdir -p /var/lib/consul \ |
| 55 | + && chown -R memcache /var/lib/consul |
| 56 | + |
| 57 | +# Reset entrypoint from base image |
24 | 58 | ENTRYPOINT []
|
| 59 | + |
| 60 | +# Reset to memcache user to, um, run memcache |
25 | 61 | USER memcache
|
26 | 62 | CMD ["/usr/local/bin/containerpilot", \
|
27 | 63 | "memcached", \
|
|
0 commit comments