diff --git a/docker/Dockerfile b/docker/Dockerfile index 102ef46461..a49ad5a9ef 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,17 +6,11 @@ ARG BASEIMGTYPE=docker # https://github.com/hassio-addons/addon-debian-base/releases -FROM ghcr.io/hassio-addons/debian-base/amd64:5.3.0 AS base-hassio-amd64 -FROM ghcr.io/hassio-addons/debian-base/aarch64:5.3.0 AS base-hassio-arm64 -FROM ghcr.io/hassio-addons/debian-base/armv7:5.3.0 AS base-hassio-armv7 +FROM ghcr.io/hassio-addons/debian-base:6.1.3 AS base-hassio # https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye -FROM debian:bullseye-20220328-slim AS base-docker-amd64 -FROM debian:bullseye-20220328-slim AS base-docker-arm64 -FROM debian:bullseye-20220328-slim AS base-docker-armv7 +FROM debian:bullseye-20221024-slim AS base-docker -# Use TARGETARCH/TARGETVARIANT defined by docker -# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope -FROM base-${BASEIMGTYPE}-${TARGETARCH}${TARGETVARIANT} AS base +FROM base-${BASEIMGTYPE} AS base RUN \ apt-get update \ @@ -29,8 +23,8 @@ RUN \ python3-cryptography=3.3.2-1 \ iputils-ping=3:20210202-1 \ git=1:2.30.2-1 \ - curl=7.74.0-1.3+deb11u1 \ - openssh-client=1:8.4p1-5 \ + curl=7.74.0-1.3+deb11u3 \ + openssh-client=1:8.4p1-5+deb11u1 \ && rm -rf \ /tmp/* \ /var/{cache,log}/* \ diff --git a/docker/ha-addon-rootfs/etc/cont-init.d/30-dirs.sh b/docker/ha-addon-rootfs/etc/cont-init.d/30-dirs.sh old mode 100644 new mode 100755 diff --git a/docker/ha-addon-rootfs/etc/services.d/esphome/finish b/docker/ha-addon-rootfs/etc/services.d/esphome/finish index 789a65e90c..fed449ce61 100755 --- a/docker/ha-addon-rootfs/etc/services.d/esphome/finish +++ b/docker/ha-addon-rootfs/etc/services.d/esphome/finish @@ -3,7 +3,13 @@ # Community Hass.io Add-ons: ESPHome # Take down the S6 supervision tree when ESPHome fails # ============================================================================== -if -n { s6-test $# -ne 0 } -if -n { s6-test ${1} -eq 256 } -s6-svscanctl -t /var/run/s6/services +declare APP_EXIT_CODE=${1} + +if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then + bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}" + echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode + exec /run/s6/basedir/bin/halt +fi + +bashio::log.info "Service restart after closing" diff --git a/docker/ha-addon-rootfs/etc/services.d/nginx/finish b/docker/ha-addon-rootfs/etc/services.d/nginx/finish index 953f3771e0..8030841ec8 100755 --- a/docker/ha-addon-rootfs/etc/services.d/nginx/finish +++ b/docker/ha-addon-rootfs/etc/services.d/nginx/finish @@ -3,7 +3,13 @@ # Community Hass.io Add-ons: ESPHome # Take down the S6 supervision tree when NGINX fails # ============================================================================== -if -n { s6-test $# -ne 0 } -if -n { s6-test ${1} -eq 256 } -s6-svscanctl -t /var/run/s6/services +declare APP_EXIT_CODE=${1} + +if [[ "${APP_EXIT_CODE}" -ne 0 ]] && [[ "${APP_EXIT_CODE}" -ne 256 ]]; then + bashio::log.warning "Halt add-on with exit code ${APP_EXIT_CODE}" + echo "${APP_EXIT_CODE}" > /run/s6-linux-init-container-results/exitcode + exec /run/s6/basedir/bin/halt +fi + +bashio::log.info "Service restart after closing"