Skip to content

Commit

Permalink
Upgrade s6-overlay from 2.2.0.3 to 3.1.0.1 (#176)
Browse files Browse the repository at this point in the history
Co-authored-by: Franck Nijhof <[email protected]>
  • Loading branch information
felipecrs and frenck authored Jun 7, 2022
1 parent 2364175 commit 113f723
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
21 changes: 17 additions & 4 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ENV \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
TERM="xterm-256color"

# Copy root filesystem
Expand All @@ -24,6 +25,7 @@ RUN \
\
&& apk add --no-cache --virtual .build-dependencies \
tar=1.34-r0 \
xz=5.2.5-r1 \
\
&& apk add --no-cache \
libcrypto1.1=1.1.1o-r0 \
Expand All @@ -37,12 +39,23 @@ RUN \
jq=1.6-r1 \
tzdata=2022a-r0 \
\
&& S6_VERSION="3.1.0.1" \
&& S6_ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "i386" ]; then S6_ARCH="x86"; fi \
&& if [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
&& if [ "${BUILD_ARCH}" = "i386" ]; then S6_ARCH="i686"; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then S6_ARCH="x86_64"; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-${S6_ARCH}.tar.gz" \
| tar zxvf - -C / \
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-noarch.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-symlinks-noarch.tar.xz" \
| tar -C / -Jxpf - \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-symlinks-arch.tar.xz" \
| tar -C / -Jxpf - \
\
&& mkdir -p /etc/fix-attrs.d \
&& mkdir -p /etc/services.d \
Expand Down
17 changes: 0 additions & 17 deletions base/rootfs/etc/cont-finish.d/99-message.sh

This file was deleted.

2 changes: 1 addition & 1 deletion base/rootfs/etc/cont-init.d/00-banner.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Displays a simple add-on banner on startup
Expand Down
2 changes: 1 addition & 1 deletion base/rootfs/etc/cont-init.d/01-log-level.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bashio
#!/command/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Sets the log level correctly
Expand Down
9 changes: 4 additions & 5 deletions base/rootfs/usr/bin/service
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# This script patches all service commands into the appropriate s6- commands
# Why not systemd? Docker said no, so did we ;)
# ==============================================================================

start() {
s6-svc -wU -u -T2500 "/var/run/s6/services/${service}"
s6-svc -wU -u -T2500 "/run/service/${service}"
}

stop() {
s6-svc -wD -d -T2500 "/var/run/s6/services/${service}"
s6-svc -wD -d -T2500 "/run/service/${service}"
}

restart() {
Expand All @@ -19,13 +18,13 @@ restart() {
}

status() {
s6-svstat "/var/run/s6/services/${service}"
s6-svstat "/run/service/${service}"
}

service="$1"
command="$2"

if [[ ! -d "/var/run/s6/services/${service}" ]] ; then
if [[ ! -d "/run/service/${service}" ]] ; then
echo "s6 service not found for ${service}, exiting..."
exit
fi;
Expand Down

0 comments on commit 113f723

Please sign in to comment.