Skip to content

Commit

Permalink
Merge pull request #13 from bryanlatten/feature-alpine-3.5
Browse files Browse the repository at this point in the history
Dockerfile: updated Alpine to 3.5
  • Loading branch information
bryanlatten authored Jan 23, 2017
2 parents c69abb0 + 0572fff commit f6b0ed8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.4
FROM alpine:3.5
LABEL Maintainer="Bryan Latten <[email protected]>"

# Use in multi-phase builds, when an init process requests for the container to gracefully exit, so that it may be committed
Expand All @@ -13,7 +13,12 @@ ENV SIGNAL_BUILD_STOP=99 \
# Ensure scripts are available for use in next command
COPY ./container/root/scripts/* /scripts/

RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
# - Symlink variant-specific scripts to default location
# - Add additional repositories to pull packages from
# - Add S6 for zombie reaping, boot-time coordination, signal transformation/distribution: @see https://github.com/just-containers/s6-overlay#known-issues-and-workarounds
# - Add goss for local, serverspec-like testing
RUN ln -s /scripts/clean_alpine.sh /clean.sh && \
echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk update && \
apk add --no-cache \
sed \
Expand All @@ -29,7 +34,7 @@ RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/r
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/*
/bin/bash -e /clean.sh

# Overlay the root filesystem from this repo
COPY ./container/root /
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ On Ubuntu and CentOS-based variants, run:

This file is actually a symlink to the variant-specific script contained in the `/scripts` folder

NOTE: for Alpine variant, which is security-conscious, but does not have a mechanism to isolate security-specific updates, use `apk update && apk upgrade` as a generic alternative.

### Packaging

A convenience script is provided for post-package installation cleanup

On Ubuntu and CentOS-based variants, run:
On all variants, run:
```/bin/bash -e /clean.sh```

This file, like security_updates (above) is actually a symlink to the variant-specific script contained in the `/scripts` folder
Expand Down
10 changes: 10 additions & 0 deletions container/root/scripts/clean_alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e

# --- Alpine variant only, for other variants, see /scripts folder

#-------------------------------------------------------------------
# Performs cleanup, ensure unnecessary packages and package lists
# are safely removed, without triggering Docker AUFS permission bug
#-------------------------------------------------------------------

rm -rf /var/cache/apk/*

0 comments on commit f6b0ed8

Please sign in to comment.