-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bryanlatten/feature-centos
Centos: added as variant
- Loading branch information
Showing
10 changed files
with
117 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ services: | |
script: | ||
- docker build . | ||
- docker build -f Dockerfile-alpine . | ||
- docker build -f Dockerfile-centos . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM ubuntu:16.04 | ||
MAINTAINER Bryan Latten <[email protected]> | ||
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 | ||
# Used with alternative CMD (worker.sh), leverages supervisor to maintain long-running processes | ||
|
@@ -8,14 +8,18 @@ ENV SIGNAL_BUILD_STOP=99 \ | |
S6_KILL_FINISH_MAXTIME=5000 \ | ||
S6_KILL_GRACETIME=3000 \ | ||
S6_VERSION=v1.18.1.5 \ | ||
GOSS_VERSION=v0.2.4 | ||
GOSS_VERSION=v0.2.5 | ||
|
||
# Ensure scripts are available for use in next command | ||
COPY ./container/root/security_updates.sh / \ | ||
./container/root/clean.sh / | ||
COPY ./container/root/scripts/* /scripts/ | ||
|
||
# - Symlink variant-specific scripts to default location | ||
# - Upgrade base security packages, then clean packaging leftover | ||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | ||
# - 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_ubuntu.sh /clean.sh && \ | ||
ln -s /scripts/security_updates_ubuntu.sh /security_updates.sh && \ | ||
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ | ||
/bin/bash -e /security_updates.sh && \ | ||
apt-get install -yqq \ | ||
curl \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM alpine:3.4 | ||
MAINTAINER Bryan Latten <[email protected]> | ||
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 | ||
# Used with alternative CMD (worker.sh), leverages supervisor to maintain long-running processes | ||
|
@@ -8,7 +8,10 @@ ENV SIGNAL_BUILD_STOP=99 \ | |
S6_KILL_FINISH_MAXTIME=5000 \ | ||
S6_KILL_GRACETIME=3000 \ | ||
S6_VERSION=v1.18.1.5 \ | ||
GOSS_VERSION=v0.2.3 | ||
GOSS_VERSION=v0.2.5 | ||
|
||
# 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 && \ | ||
apk update && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM centos:7 | ||
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 | ||
# 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 \ | ||
S6_VERSION=v1.18.1.5 \ | ||
GOSS_VERSION=v0.2.5 | ||
|
||
# Ensure scripts are available for use in next command | ||
COPY ./container/root/scripts/* /scripts/ | ||
|
||
# - Symlink variant-specific scripts to default location | ||
# - Upgrade base security packages, then clean packaging leftover | ||
# - 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_centos.sh /clean.sh && \ | ||
ln -s /scripts/security_updates_centos.sh /security_updates.sh && \ | ||
/bin/bash -e /security_updates.sh && \ | ||
/bin/bash -e /clean.sh && \ | ||
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 / --exclude="./bin" --exclude="./sbin" && \ | ||
tar xzf /tmp/s6.tar.gz -C /usr ./bin ./sbin && \ | ||
rm -f /tmp/s6.tar.gz && \ | ||
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 | ||
|
||
# Overlay the root filesystem from this repo | ||
COPY ./container/root / | ||
|
||
RUN goss -g goss.base.yaml validate | ||
|
||
# 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash -e | ||
|
||
# --- Centos 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 | ||
#------------------------------------------------------------------- | ||
|
||
yum clean all |
2 changes: 2 additions & 0 deletions
2
container/root/clean.sh → container/root/scripts/clean_ubuntu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# --- Centos variant only, for other variants, see /scripts folder | ||
|
||
#------------------------------------------------------------------- | ||
# Upgrade just the packages listed as security, without affecting | ||
# any subsequent usages of yum | ||
#------------------------------------------------------------------- | ||
|
||
yum -y update --security |
2 changes: 2 additions & 0 deletions
2
container/root/security_updates.sh → ...r/root/scripts/security_updates_ubuntu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters