diff --git a/base/Dockerfile b/base/Dockerfile index 19c232b..8720c41 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -10,6 +10,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 @@ -28,21 +29,25 @@ RUN \ curl=7.68.0-1ubuntu2.11 \ jq=1.6-1ubuntu0.20.04.1 \ tzdata=2022a-0ubuntu0.20.04 \ + xz-utils=5.2.4-1 \ \ + && 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 -J -L -o /tmp/s6-overlay.tar.gz \ - "https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-${S6_ARCH}.tar.gz" \ + && curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-noarch.tar.xz" \ + | tar -C / -Jxpf - \ \ - && tar zxvfh \ - /tmp/s6-overlay.tar.gz \ - -C / \ + && curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" \ + | tar -C / -Jxpf - \ \ - && tar zxvfh \ - /tmp/s6-overlay.tar.gz \ - -C /usr ./bin \ + && 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 \ @@ -61,6 +66,9 @@ RUN \ "https://github.com/home-assistant/tempio/releases/download/2021.09.0/tempio_${BUILD_ARCH}" \ && chmod a+x /usr/bin/tempio \ \ + && apt-get purge -y --auto-remove \ + xz-utils \ + && apt-get clean \ && rm -fr \ /tmp/* \ /var/{cache,log}/* \ diff --git a/base/rootfs/etc/cont-finish.d/99-message.sh b/base/rootfs/etc/cont-finish.d/99-message.sh deleted file mode 100644 index 05703bf..0000000 --- a/base/rootfs/etc/cont-finish.d/99-message.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bashio -# ============================================================================== -# Home Assistant Community Add-on: Base Images -# Displays an message right before terminating in case something went wrong -# ============================================================================== -if [[ "${S6_STAGE2_EXITED}" -ne 0 ]]; then - bashio::log.red \ - '-----------------------------------------------------------' - bashio::log.red ' Oops! Something went wrong.' - bashio::log.red - bashio::log.red ' We are so sorry, but something went terribly wrong when' - bashio::log.red ' starting or running this add-on.' - bashio::log.red ' ' - bashio::log.red ' Be sure to check the log above, line by line, for hints.' - bashio::log.red \ - '-----------------------------------------------------------' -fi diff --git a/base/rootfs/etc/cont-init.d/00-banner.sh b/base/rootfs/etc/cont-init.d/00-banner.sh index 37a8218..7184387 100644 --- a/base/rootfs/etc/cont-init.d/00-banner.sh +++ b/base/rootfs/etc/cont-init.d/00-banner.sh @@ -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 diff --git a/base/rootfs/etc/cont-init.d/01-log-level.sh b/base/rootfs/etc/cont-init.d/01-log-level.sh index 511a167..a8ae7c8 100644 --- a/base/rootfs/etc/cont-init.d/01-log-level.sh +++ b/base/rootfs/etc/cont-init.d/01-log-level.sh @@ -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 diff --git a/base/rootfs/usr/bin/service b/base/rootfs/usr/bin/service index ff2f8db..523cebc 100755 --- a/base/rootfs/usr/bin/service +++ b/base/rootfs/usr/bin/service @@ -6,11 +6,11 @@ # ============================================================================== 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() { @@ -19,13 +19,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;