Skip to content

Commit

Permalink
Merge pull request #7 from bryanlatten/feature-s6-upgrade
Browse files Browse the repository at this point in the history
Dockerfile: update goss and S6 from env vars
  • Loading branch information
bryanlatten authored Sep 4, 2016
2 parents 4604f83 + ffc33c2 commit 3d92af3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,35 @@ MAINTAINER Bryan Latten <[email protected]>
ENV SIGNAL_BUILD_STOP=99 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_KILL_FINISH_MAXTIME=5000 \
S6_KILL_GRACETIME=3000
S6_KILL_GRACETIME=3000 \
S6_VERSION=v1.18.1.5 \
GOSS_VERSION=v0.2.3

# Upgrade base packages, then clean packaging leftover
RUN apt-get update && \
apt-get upgrade -yqq && \
apt-get install -yqq \
curl \
&& \
# Add goss for local testing
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.2.3/goss-linux-amd64 -o /usr/local/bin/goss && \
# Add S6 for zombie reaping, boot-time coordination, signal transformation/distribution
curl -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz -o /tmp/s6.tar.gz && \
tar xzf /tmp/s6.tar.gz -C / && \
rm /tmp/s6.tar.gz && \
# Add goss for local, serverspec-like testing \
curl -L https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64 -o /usr/local/bin/goss && \
chmod +x /usr/local/bin/goss && \
apt-get remove --purge -yq curl && \
apt-get remove --purge -yq \
curl \
&& \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/{cache,log}/ && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/lib/apt/lists/*.lz4 && \
rm -rf /tmp/* /var/tmp/*

# Overlay the root filesystem from this repo
COPY ./container/root /

# Add S6 overlay build, to avoid having to build from source
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
rm /tmp/s6-overlay-amd64.tar.gz

RUN goss -g goss.base.yaml validate

# NOTE: intentionally NOT using s6 init as the entrypoint
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ MAINTAINER Bryan Latten <[email protected]>
ENV SIGNAL_BUILD_STOP=99 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_KILL_FINISH_MAXTIME=5000 \
S6_KILL_GRACETIME=3000
S6_KILL_GRACETIME=3000 \
S6_VERSION=v1.18.1.5 \
GOSS_VERSION=v0.2.3

RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk update && \
Expand All @@ -16,18 +18,19 @@ RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/r
grep \
curl \
&& \
curl -L https://github.com/aelsabbahy/goss/releases/download/v0.2.3/goss-linux-amd64 -o /usr/local/bin/goss && \
# Add S6 for zombie reaping, boot-time coordination, signal transformation/distribution
curl -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz -o /tmp/s6.tar.gz && \
tar xzf /tmp/s6.tar.gz -C / && \
rm /tmp/s6.tar.gz && \
# Add goss for local, serverspec-like testing \
curl -L https://github.com/aelsabbahy/goss/releases/download/${GOSS_VERSION}/goss-linux-amd64 -o /usr/local/bin/goss && \
chmod +x /usr/local/bin/goss && \
apk del curl && \
rm -rf /var/cache/apk/*

# Overlay the root filesystem from this repo
COPY ./container/root /

# Add S6 overlay build, to avoid having to build from source
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
rm /tmp/s6-overlay-amd64.tar.gz

RUN goss -g goss.base.yaml validate

# NOTE: intentionally NOT using s6 init as the entrypoint
Expand Down
Binary file removed container/root/tmp/s6-overlay-amd64.tar.gz
Binary file not shown.

0 comments on commit 3d92af3

Please sign in to comment.