Skip to content

Commit

Permalink
⬆️ Upgrades add-on base image to 12.2.1 (#202)
Browse files Browse the repository at this point in the history
* ⬆️ Upgrades add-on base image to 12.2.1

* Fix shellcheck warnings
  • Loading branch information
frenck authored Jul 16, 2022
1 parent 28591f9 commit 1dade5f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
21 changes: 6 additions & 15 deletions appdaemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base/amd64:12.0.0
ARG BUILD_FROM=ghcr.io/hassio-addons/base:12.2.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}

Expand All @@ -12,33 +12,24 @@ COPY requirements.txt /tmp/
COPY rootfs/patches /patches

# Setup base
ARG BUILD_ARCH=amd64
# hadolint ignore=DL3003
# hadolint ignore=DL3003,DL3042
RUN \
apk add --no-cache --virtual .build-dependencies \
build-base=0.5-r2 \
libffi-dev=3.4.2-r1 \
openssl-dev=1.1.1o-r0 \
py3-wheel=0.37.1-r0 \
build-base=0.5-r3 \
python3-dev=3.10.4-r0 \
\
&& apk add --no-cache \
py3-bcrypt=3.2.2-r0 \
py3-cryptography=3.4.8-r1 \
py3-pip=22.1.1-r0 \
py3-wheel=0.37.1-r0 \
python3=3.10.4-r0 \
\
&& pip install \
--no-cache-dir \
--prefer-binary \
--find-links "https://wheels.home-assistant.io/alpine-3.16/${BUILD_ARCH}/" \
-r /tmp/requirements.txt \
&& pip install -r /tmp/requirements.txt \
\
&& cd /usr/lib/python3.10/site-packages/ \
&& patch -p1 < /patches/force_recompile.patch \
&& patch -p1 < /patches/hassio.patch \
\
&& find /usr/local \
&& find /usr \
\( -type d -a -name test -o -name tests -o -name '__pycache__' \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
Expand Down
10 changes: 5 additions & 5 deletions appdaemon/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base/aarch64:12.0.0
amd64: ghcr.io/hassio-addons/base/amd64:12.0.0
armhf: ghcr.io/hassio-addons/base/armhf:12.0.0
armv7: ghcr.io/hassio-addons/base/armv7:12.0.0
i386: ghcr.io/hassio-addons/base/i386:12.0.0
aarch64: ghcr.io/hassio-addons/base:12.2.1
amd64: ghcr.io/hassio-addons/base:12.2.1
armhf: ghcr.io/hassio-addons/base:12.2.1
armv7: ghcr.io/hassio-addons/base:12.2.1
i386: ghcr.io/hassio-addons/base:12.2.1
codenotary:
base_image: [email protected]
signer: [email protected]
9 changes: 2 additions & 7 deletions appdaemon/rootfs/etc/cont-init.d/appdaemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Home Assistant Community Add-on: AppDaemon
# Configures AppDaemon
# ==============================================================================
declare arch

# Creates initial AppDaemon configuration in case it is non-existing
if ! bashio::fs.directory_exists '/config/appdaemon'; then
Expand Down Expand Up @@ -38,13 +37,9 @@ fi

# Install user configured/requested Python packages
if bashio::config.has_value 'python_packages'; then
arch=$(bashio::info.arch)
for package in $(bashio::config 'python_packages'); do
pip3 install \
--prefer-binary \
--find-links "https://wheels.home-assistant.io/alpine-3.14/${arch}/" \
"$package" \
|| bashio::exit.nok "Failed installing package ${package}"
pip3 install "$package" \
|| bashio::exit.nok "Failed installing package ${package}"
done
fi

Expand Down
2 changes: 1 addition & 1 deletion appdaemon/rootfs/etc/services.d/appdaemon/finish
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ==============================================================================
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
bashio::log.warning "AppDaemon crashed, halting add-on"
/run/s6/basedir/bin/halt
exec /run/s6/basedir/bin/halt
fi

bashio::log.info "AppDaemon stoped, restarting..."

0 comments on commit 1dade5f

Please sign in to comment.