🔨 Migrate old-style base scripts s6-rc (#130)

This commit is contained in:
Franck Nijhof 2022-12-15 12:35:34 +01:00 committed by GitHub
parent 0b090c6fb2
commit 9623b3b949
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 32 additions and 9 deletions

View file

@ -20,14 +20,12 @@ ENV \
YARN_HTTP_TIMEOUT=1000000 \
TERM="xterm-256color"
# Copy root filesystem
COPY rootfs /
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Install base system
ARG BUILD_ARCH=amd64
ARG S6_OVERLAY_VERSION="3.1.2.1"
RUN \
apt-get update \
\
@ -38,22 +36,21 @@ RUN \
tzdata=2022g-0ubuntu0.20.04.1 \
xz-utils=5.2.4-1ubuntu1.1 \
\
&& S6_VERSION="3.1.2.1" \
&& S6_ARCH="${BUILD_ARCH}" \
&& 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/v${S6_VERSION}/s6-overlay-noarch.tar.xz" \
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_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" \
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_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" \
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_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" \
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz" \
| tar -C / -Jxpf - \
\
&& mkdir -p /etc/fix-attrs.d \
@ -81,6 +78,12 @@ RUN \
/var/{cache,log}/* \
/var/lib/apt/lists/*
# Copy root filesystem
COPY rootfs /
# Copy s6-overlay adjustments
COPY s6-overlay /package/admin/s6-overlay-${S6_OVERLAY_VERSION}/
# Entrypoint & CMD
ENTRYPOINT [ "/init" ]

View file

@ -1,4 +1,5 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Displays a simple add-on banner on startup

View file

@ -1,4 +1,5 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Sets the log level correctly
@ -9,7 +10,7 @@ declare log_level
if bashio::config.exists log_level; then
# Find the matching LOG_LEVEL
log_level=$(bashio::string.lower "$(bashio::config log_level)")
log_level=$(bashio::string.lower "$(bashio::config log_level)")
case "${log_level}" in
all)
log_level="${__BASHIO_LOG_LEVEL_ALL}"

View file

@ -0,0 +1,12 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# Configures the timezone
# ==============================================================================
bashio::log.info "Configuring timezone (${TZ:-None})..."
ln --symbolic --no-dereference --force "/usr/share/zoneinfo/${TZ:-UTC}" /etc/localtime
echo "${TZ:-UTC}" > /etc/timezone
dpkg-reconfigure --frontend noninteractive tzdata 2> /dev/null

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-banner

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-log-level

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-timezone