mirror of
https://github.com/hassio-addons/addon-debian-base.git
synced 2025-05-03 18:51:23 +00:00
🔨 Migrate old-style base scripts s6-rc (#130)
This commit is contained in:
parent
afd8784e9b
commit
d3b714ce1c
18 changed files with 25 additions and 12 deletions
|
@ -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 \
|
||||
\
|
||||
|
@ -41,22 +39,21 @@ RUN \
|
|||
\
|
||||
&& c_rehash \
|
||||
\
|
||||
&& 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 \
|
||||
|
@ -84,6 +81,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" ]
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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}"
|
|
@ -1,10 +1,12 @@
|
|||
#!/command/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Base Images
|
||||
# Configures the timezone
|
||||
# ==============================================================================
|
||||
|
||||
bashio::log.info "Configuring timezone"
|
||||
bashio::log.info "Configuring timezone (${TZ:-None})..."
|
||||
|
||||
ln --symbolic --no-dereference --force "/usr/share/zoneinfo/${TZ}" /etc/localtime
|
||||
echo "${TZ}" > /etc/timezone
|
||||
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
|
1
base/s6-overlay/etc/s6-rc/sources/base-addon-banner/type
Normal file
1
base/s6-overlay/etc/s6-rc/sources/base-addon-banner/type
Normal file
|
@ -0,0 +1 @@
|
|||
oneshot
|
1
base/s6-overlay/etc/s6-rc/sources/base-addon-banner/up
Normal file
1
base/s6-overlay/etc/s6-rc/sources/base-addon-banner/up
Normal file
|
@ -0,0 +1 @@
|
|||
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-banner
|
|
@ -0,0 +1 @@
|
|||
oneshot
|
|
@ -0,0 +1 @@
|
|||
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-log-level
|
|
@ -0,0 +1 @@
|
|||
oneshot
|
1
base/s6-overlay/etc/s6-rc/sources/base-addon-timezone/up
Normal file
1
base/s6-overlay/etc/s6-rc/sources/base-addon-timezone/up
Normal file
|
@ -0,0 +1 @@
|
|||
/package/admin/s6-overlay/etc/s6-rc/scripts/base-addon-timezone
|
Loading…
Add table
Add a link
Reference in a new issue