Skip to content

Commit

Permalink
Cent: added 8.X variant (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryan Latten <[email protected]>
  • Loading branch information
bryanlatten and Bryan Latten authored Aug 25, 2020
1 parent a434c80 commit 95e7bb1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ script:
- docker build .
- docker build -f Dockerfile-alpine .
- docker build -f Dockerfile-centos .
- docker build -f Dockerfile-centos-8 .
- docker build -f Dockerfile-ubuntu-18.04 .
- docker build -f Dockerfile-ubuntu-20.04 .
- ./test.sh
40 changes: 40 additions & 0 deletions Dockerfile-centos-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM centos:8 as base

### Stage 1 - add/remove packages ###

# 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 && \
rpm -e systemd --nodeps && \
/bin/bash -e /clean.sh && \
/bin/bash -e /scripts/install_s6.sh && \
/bin/bash -e /scripts/install_goss.sh

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


### Stage 2 --- collapse layers ###

FROM scratch
COPY --from=base / .

# 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 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"]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Provides base OS, security patches, and tools for quick and easy spinup.
* Ubuntu 18.04 LTS available, tagged as `-VERSION#-ubuntu-18.04`
* Ubuntu 20.04 LTS available, tagged as `-VERSION#-ubuntu-20.04`
* Alpine builds available, tagged as `-alpine`
* Centos builds available, tagged as `-centos`
* Centos 7 builds available, tagged as `-centos`
* Centos 8 builds available, tagged as `-centos-8`



Expand Down

0 comments on commit 95e7bb1

Please sign in to comment.