Skip to content

Commit

Permalink
Merge pull request #5 from bryanlatten/feature-alpine
Browse files Browse the repository at this point in the history
Dockerfile: added alpine alternative
  • Loading branch information
bryanlatten authored Jul 29, 2016
2 parents 76330fa + 7832845 commit 637bf98
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM alpine:3.4
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
# Used with alternative CMD (worker.sh), leverages supervisor to maintain long-running processes
ENV SIGNAL_BUILD_STOP=99 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_KILL_FINISH_MAXTIME=5000 \
S6_KILL_GRACETIME=3000

RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories && \
apk update && \
apk add --no-cache \
sed \
bash \
grep \
&& \
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

# NOTE: intentionally NOT using s6 init as the entrypoint
# This would prevent container debugging if any of those service crash
CMD ["/bin/bash", "/run.sh"]
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ubuntu:
build: .
ports:
- '8080:8080'
environment:
SERVER_LOG_MINIMAL: 1
SERVER_APP_NAME: docker-test
S6_KILL_FINISH_MAXTIME: 1
S6_KILL_GRACETIME: 1
alpine:
build: .
dockerfile: Dockerfile-alpine
ports:
- '8081:8080'
environment:
SERVER_LOG_MINIMAL: 1
SERVER_APP_NAME: docker-test
S6_KILL_FINISH_MAXTIME: 1
S6_KILL_GRACETIME: 1

0 comments on commit 637bf98

Please sign in to comment.