Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base image to ubuntu-base:9.0.4 #491

Merged
merged 4 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions unifi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/ubuntu-base:8.2.0
ARG BUILD_FROM=ghcr.io/hassio-addons/ubuntu-base:9.0.4
# hadolint ignore=DL3006
frenck marked this conversation as resolved.
Show resolved Hide resolved
FROM ${BUILD_FROM}

# Set shell
ARG BUILD_ARCH=amd64
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Setup base system
RUN \
apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
binutils=2.34-6ubuntu1.8 \
libcap2=1:2.32-1ubuntu0.1 \
logrotate=3.14.0-4ubuntu3 \
mongodb-server=1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 \
binutils=2.38-4ubuntu2.6 \
logrotate=3.19.0-1ubuntu1.1 \
openjdk-17-jre-headless=17* \
\
&& pkgname=libssl1.1_1.1.1f-1ubuntu2.22 \
&& if [ "${BUILD_ARCH}" = "aarch64" ]; then pkgurl="http://ports.ubuntu.com/pool/main/o/openssl/${pkgname}_arm64.deb"; fi \
&& if [ "${BUILD_ARCH}" = "amd64" ]; then pkgurl="http://security.ubuntu.com/ubuntu/pool/main/o/openssl/${pkgname}_amd64.deb"; fi \
&& curl -L -o /tmp/libssl.deb "${pkgurl}" \
&& dpkg --install "/tmp/libssl.deb" \
&& curl -J -L -o /etc/apt/keyrings/mongodb-server-4.4.gpg https://pgp.mongodb.com/server-4.4.pub \
&& echo "deb [ arch=amd64,arm64 signed-by=/etc/apt/keyrings/mongodb-server-4.4.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" >/etc/apt/sources.list.d/mongodb-org-4.4.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends mongodb-org-server=4.4.29 \
&& curl -J -L -o /tmp/unifi.deb \
"https://dl.ui.com/unifi/8.0.28/unifi_sysvinit_all.deb" \
\
Expand All @@ -36,7 +44,6 @@ HEALTHCHECK --start-period=5m \
CMD curl --insecure --fail https://localhost:8443 || exit 1

# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
Expand Down
4 changes: 2 additions & 2 deletions unifi/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/ubuntu-base:8.2.0
amd64: ghcr.io/hassio-addons/ubuntu-base:8.2.0
aarch64: ghcr.io/hassio-addons/ubuntu-base:9.0.4
amd64: ghcr.io/hassio-addons/ubuntu-base:9.0.4
codenotary:
base_image: [email protected]
signer: [email protected]
16 changes: 8 additions & 8 deletions unifi/rootfs/etc/s6-overlay/s6-rc.d/init-unifi/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ fi
rm -fr /usr/lib/unifi/data/backup
ln -s /backup/unifi /usr/lib/unifi/data/backup

# Enable small files on MongoDB
if ! bashio::fs.file_exists "${properties}"; then
touch "${properties}"
echo "unifi.db.extraargs=--smallfiles" > "${properties}"
fi

#shellcheck disable=SC2016
# Remove --smallfiles argument from properties file, it's no longer present in mongoDB >= 4.2
# https://www.mongodb.com/docs/v4.2/reference/configuration-options/#removed-mmapv1-options
if bashio::fs.file_exists "${properties}"; then
sed -i \
'/^unifi.db.extraargs=/{h;s/=.*/=--smallfiles/};${x;/^$/{s//unifi.db.extraargs=--smallfiles/;H};x}' \
's/^\(unifi.db.extraargs=.*\)--smallfiles/\1/' \
"${properties}"
sed -i \
'/^unifi.db.extraargs= *$/d' \
"${properties}"
fi

# If there is no keystore yet, we are good to go
if ! bashio::fs.file_exists "${KEYSTORE}"; then
Expand Down
Loading