Skip to content

Commit

Permalink
refactor: replace supervisord with s6
Browse files Browse the repository at this point in the history
This change looks to drop the python dependency in the base image and replaces supervisord with [s6](https://github.com/just-containers/s6-overlay).

If we could get this branch pushed to the `s6` tag on Docker it will allow us to test this with the downstream containers.

I will update the README.md if it's decided that we will adopt s6 over supervisord.
  • Loading branch information
nightah committed Oct 16, 2021
1 parent 1d80e54 commit a77d6b9
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 156 deletions.
37 changes: 20 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
FROM ubuntu:bionic
MAINTAINER LanCache.Net Team <[email protected]>

ARG DEBIAN_FRONTEND=noninteractive
RUN \
apt-get -y update && apt-get -y upgrade && \
apt-get -y install python3-pip curl wget bzip2 locales tzdata && \
locale-gen en_GB.utf8 && \
update-locale LANG=en_GB.utf8
RUN \
pip3 install supervisor && \
mkdir --mode 777 -p /var/log/supervisor
RUN \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*
ARG ARCH="amd64"
ARG OVERLAY_VERSION="v2.2.0.3"

ENV \
SUPERVISORD_EXIT_ON_FATAL=1 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
LC_ALL=en_GB.UTF-8 \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB.UTF-8 \
TZ=Europe/London \
SUPERVISORD_LOGLEVEL=WARN
TZ=Europe/London

COPY overlay/ /
RUN chmod -R 755 /init /hooks
ENTRYPOINT ["/bin/bash", "-e", "/init/entrypoint"]
CMD ["/init/supervisord"]

RUN \
apt-get -y update && apt-get -y upgrade && \
apt-get -y install curl wget bzip2 locales tzdata && \
locale-gen en_GB.utf8 && \
update-locale LANG=en_GB.utf8 \
cd /tmp && \
curl -sSfL -o s6-overlay.tar.gz "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.gz" && \
tar xfz s6-overlay.tar.gz -C / && \
apt-get -y clean && \
rm -rf /tmp/* /var/lib/apt/lists/*

ENTRYPOINT ["/init"]
4 changes: 1 addition & 3 deletions goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package:
installed: true
curl:
installed: true
python3-pip:
installed: true
wget:
installed: true
process:
supervisord:
s6-svscan:
running: true
12 changes: 12 additions & 0 deletions overlay/etc/cont-init.d/00-asciilogo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bash

cat <<EOF
_ _____ _ _
| | / ____| | | | |
| | __ _ _ __ | | __ _ ___| |__ ___ _ __ ___| |_
| | / _\` | '_ \| | / _\` |/ __| '_ \ / _ \ | '_ \ / _ \ __|
| |___| (_| | | | | |___| (_| | (__| | | | __/_| | | | __/ |_
|______\__,_|_| |_|\_____\__,_|\___|_| |_|\___(_)_| |_|\___|\__|


EOF
Empty file.
18 changes: 0 additions & 18 deletions overlay/etc/supervisor/supervisord.conf

This file was deleted.

Empty file removed overlay/hooks/.gitkeep
Empty file.
Empty file.
9 changes: 0 additions & 9 deletions overlay/hooks/entrypoint-pre.d/00_asciilogo.sh

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions overlay/hooks/supervisord-ready

This file was deleted.

68 changes: 0 additions & 68 deletions overlay/init/entrypoint

This file was deleted.

29 changes: 0 additions & 29 deletions overlay/init/supervisord

This file was deleted.

8 changes: 1 addition & 7 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#!/bin/bash

if [[ "$@" == *" -- "* ]]; then
SD_LOGLEVEL="-e SUPERVISORD_LOGLEVEL=INFO"
else
SD_LOGLEVEL="-- -e SUPERVISORD_LOGLEVEL=INFO"
fi

curl -fsSL https://raw.githubusercontent.com/lancachenet/test-suite/master/dgoss-tests.sh | bash -s -- --imagename="lancachenet/ubuntu:goss-test" $@ $SD_LOGLEVEL
curl -fsSL https://raw.githubusercontent.com/lancachenet/test-suite/master/dgoss-tests.sh | bash -s -- --imagename="lancachenet/ubuntu:goss-test" $@

0 comments on commit a77d6b9

Please sign in to comment.