From 0f3a1456cbdde90e0ed3f611d6af3f1aed3b5b94 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Thu, 3 Aug 2023 07:29:28 -0700 Subject: unifi: update version and checksum method --- unifi/Dockerfile | 14 +++++++------- unifi/Makefile | 17 +++++++++-------- unifi/unifi-setup.sh | 2 ++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/unifi/Dockerfile b/unifi/Dockerfile index a04d001..208d05b 100644 --- a/unifi/Dockerfile +++ b/unifi/Dockerfile @@ -3,15 +3,15 @@ LABEL maintainer="Mike Crute " # TODO: Move all the unpacking stuff to the Makefile -ARG deb_location -ARG checksum_line +ARG deb_version +ARG checksum ADD log4j.properties /tmp/ RUN set -euxo pipefail; \ # Validate required arguments were passed - test -z "${deb_location}" && { echo -e "\033[31mMissing build parameter 'deb_location'\033[39m"; exit 1; }; \ - test -z "${checksum_line}" && { echo -e "\033[31mMissing build parameter 'checksum_line'\033[39m"; exit 1; }; \ + test -z "${deb_version}" && { echo -e "\033[31mMissing build parameter 'deb_version'\033[39m"; exit 1; }; \ + test -z "${checksum}" && { echo -e "\033[31mMissing build parameter 'checksum'\033[39m"; exit 1; }; \ \ # Install build and run dependencies apk add --no-cache --virtual .build-deps \ @@ -28,13 +28,13 @@ RUN set -euxo pipefail; \ # mongodb \ mongodb-tools \ nss \ - openjdk8-jre-base \ + openjdk11-jre-headless \ su-exec \ \ # Fetch the Unifi package and validate the checksum before unpacking && cd /tmp \ - && curl -sO "$deb_location" \ - && echo "${checksum_line}" > checksums.txt \ + && curl -sO "https://dl.ui.com/unifi/${deb_version}/unifi_sysvinit_all.deb" \ + && echo "${checksum} *unifi_sysvinit_all.deb" > checksums.txt \ && sha256sum -sc checksums.txt \ \ # Unpack the debian package and "install" it diff --git a/unifi/Makefile b/unifi/Makefile index b1c9503..feded0a 100644 --- a/unifi/Makefile +++ b/unifi/Makefile @@ -1,24 +1,25 @@ -VERSION=7.2.91-85c367a4aa -VERSION_TAG=$(VERSION)-1 +VERSION=7.4.162 +VERSION_SUFFIX=-3116043f9f +VERSION_TAG=$(VERSION)-0 IMAGE=docker.crute.me/unifi:$(VERSION_TAG) LATEST=$(subst :$(VERSION_TAG),,$(IMAGE)):latest -DEB_LOCATION="https://dl.ui.com/unifi/$(VERSION)/unifi_sysvinit_all.deb" -CHECKSUM_LINE="d33e7b5a838a4c301ca545910e7119ba62bda80202259655191ced1e482cecde *unifi_sysvinit_all.deb" +DEB_VERSION="$(VERSION)$(VERSION_SUFFIX)" +CHECKSUM="069652f793498124468c985537a569f3fe1d8dd404be3fb69df6b2d18b153c4c" all: docker pull alpine:latest docker build \ --no-cache \ - --build-arg=deb_location=$(DEB_LOCATION) \ - --build-arg=checksum_line=$(CHECKSUM_LINE) \ + --build-arg=deb_version=$(DEB_VERSION) \ + --build-arg=checksum=$(CHECKSUM) \ -t $(IMAGE) . all-no-cache: docker build \ --no-cache \ - --build-arg=deb_location=$(DEB_LOCATION) \ - --build-arg=checksum_line=$(CHECKSUM_LINE) \ + --build-arg=deb_version=$(DEB_VERSION) \ + --build-arg=checksum=$(CHECKSUM) \ -t $(IMAGE) . run: diff --git a/unifi/unifi-setup.sh b/unifi/unifi-setup.sh index 30defdc..86153b5 100755 --- a/unifi/unifi-setup.sh +++ b/unifi/unifi-setup.sh @@ -34,6 +34,8 @@ chown -R ${USERNAME}:${USERNAME} \ /var/run/unifi \ /usr/lib/unifi/dl +ln -s /var/log/unifi /logs + # Cleanup mongodb lock file if it exists otherwise the controller will freeze # forever trying to start Mongo [ -f data/db/mongod.lock ] && rm data/db/mongod.lock -- cgit v1.2.3