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 Sep 24, 2024
1 parent 55879d5 commit 48b082b
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 151 deletions.
38 changes: 21 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
FROM ubuntu:24.04
LABEL maintainer="LanCache.Net Team <team@lancache.net>"
ARG DEBIAN_FRONTEND=noninteractive

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

ENV \
SUPERVISORD_EXIT_ON_FATAL=1 \
LC_ALL=en_GB.UTF-8 \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB.UTF-8 \
TZ=Europe/London \
SUPERVISORD_LOGLEVEL=WARN
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

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 --no-install-recommends && \
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"]
2 changes: 1 addition & 1 deletion goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ package:
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.
68 changes: 0 additions & 68 deletions overlay/init/entrypoint

This file was deleted.

31 changes: 0 additions & 31 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 48b082b

Please sign in to comment.