diff options
author | Mike Crute <mike@crute.us> | 2023-08-03 07:29:28 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-08-03 07:29:28 -0700 |
commit | 0f3a1456cbdde90e0ed3f611d6af3f1aed3b5b94 (patch) | |
tree | 513b808d18796df47318d7fe90a5bac41994636b | |
parent | f21781bbc2052fe1dd9007a92b59b9f5696d5627 (diff) | |
download | dockerfiles-0f3a1456cbdde90e0ed3f611d6af3f1aed3b5b94.tar.bz2 dockerfiles-0f3a1456cbdde90e0ed3f611d6af3f1aed3b5b94.tar.xz dockerfiles-0f3a1456cbdde90e0ed3f611d6af3f1aed3b5b94.zip |
unifi: update version and checksum method
-rw-r--r-- | unifi/Dockerfile | 14 | ||||
-rw-r--r-- | unifi/Makefile | 17 | ||||
-rwxr-xr-x | 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 <mike@crute.us>" | |||
3 | 3 | ||
4 | # TODO: Move all the unpacking stuff to the Makefile | 4 | # TODO: Move all the unpacking stuff to the Makefile |
5 | 5 | ||
6 | ARG deb_location | 6 | ARG deb_version |
7 | ARG checksum_line | 7 | ARG checksum |
8 | 8 | ||
9 | ADD log4j.properties /tmp/ | 9 | ADD log4j.properties /tmp/ |
10 | 10 | ||
11 | RUN set -euxo pipefail; \ | 11 | RUN set -euxo pipefail; \ |
12 | # Validate required arguments were passed | 12 | # Validate required arguments were passed |
13 | test -z "${deb_location}" && { echo -e "\033[31mMissing build parameter 'deb_location'\033[39m"; exit 1; }; \ | 13 | test -z "${deb_version}" && { echo -e "\033[31mMissing build parameter 'deb_version'\033[39m"; exit 1; }; \ |
14 | test -z "${checksum_line}" && { echo -e "\033[31mMissing build parameter 'checksum_line'\033[39m"; exit 1; }; \ | 14 | test -z "${checksum}" && { echo -e "\033[31mMissing build parameter 'checksum'\033[39m"; exit 1; }; \ |
15 | \ | 15 | \ |
16 | # Install build and run dependencies | 16 | # Install build and run dependencies |
17 | apk add --no-cache --virtual .build-deps \ | 17 | apk add --no-cache --virtual .build-deps \ |
@@ -28,13 +28,13 @@ RUN set -euxo pipefail; \ | |||
28 | # mongodb \ | 28 | # mongodb \ |
29 | mongodb-tools \ | 29 | mongodb-tools \ |
30 | nss \ | 30 | nss \ |
31 | openjdk8-jre-base \ | 31 | openjdk11-jre-headless \ |
32 | su-exec \ | 32 | su-exec \ |
33 | \ | 33 | \ |
34 | # Fetch the Unifi package and validate the checksum before unpacking | 34 | # Fetch the Unifi package and validate the checksum before unpacking |
35 | && cd /tmp \ | 35 | && cd /tmp \ |
36 | && curl -sO "$deb_location" \ | 36 | && curl -sO "https://dl.ui.com/unifi/${deb_version}/unifi_sysvinit_all.deb" \ |
37 | && echo "${checksum_line}" > checksums.txt \ | 37 | && echo "${checksum} *unifi_sysvinit_all.deb" > checksums.txt \ |
38 | && sha256sum -sc checksums.txt \ | 38 | && sha256sum -sc checksums.txt \ |
39 | \ | 39 | \ |
40 | # Unpack the debian package and "install" it | 40 | # 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 @@ | |||
1 | VERSION=7.2.91-85c367a4aa | 1 | VERSION=7.4.162 |
2 | VERSION_TAG=$(VERSION)-1 | 2 | VERSION_SUFFIX=-3116043f9f |
3 | VERSION_TAG=$(VERSION)-0 | ||
3 | IMAGE=docker.crute.me/unifi:$(VERSION_TAG) | 4 | IMAGE=docker.crute.me/unifi:$(VERSION_TAG) |
4 | LATEST=$(subst :$(VERSION_TAG),,$(IMAGE)):latest | 5 | LATEST=$(subst :$(VERSION_TAG),,$(IMAGE)):latest |
5 | 6 | ||
6 | DEB_LOCATION="https://dl.ui.com/unifi/$(VERSION)/unifi_sysvinit_all.deb" | 7 | DEB_VERSION="$(VERSION)$(VERSION_SUFFIX)" |
7 | CHECKSUM_LINE="d33e7b5a838a4c301ca545910e7119ba62bda80202259655191ced1e482cecde *unifi_sysvinit_all.deb" | 8 | CHECKSUM="069652f793498124468c985537a569f3fe1d8dd404be3fb69df6b2d18b153c4c" |
8 | 9 | ||
9 | all: | 10 | all: |
10 | docker pull alpine:latest | 11 | docker pull alpine:latest |
11 | docker build \ | 12 | docker build \ |
12 | --no-cache \ | 13 | --no-cache \ |
13 | --build-arg=deb_location=$(DEB_LOCATION) \ | 14 | --build-arg=deb_version=$(DEB_VERSION) \ |
14 | --build-arg=checksum_line=$(CHECKSUM_LINE) \ | 15 | --build-arg=checksum=$(CHECKSUM) \ |
15 | -t $(IMAGE) . | 16 | -t $(IMAGE) . |
16 | 17 | ||
17 | all-no-cache: | 18 | all-no-cache: |
18 | docker build \ | 19 | docker build \ |
19 | --no-cache \ | 20 | --no-cache \ |
20 | --build-arg=deb_location=$(DEB_LOCATION) \ | 21 | --build-arg=deb_version=$(DEB_VERSION) \ |
21 | --build-arg=checksum_line=$(CHECKSUM_LINE) \ | 22 | --build-arg=checksum=$(CHECKSUM) \ |
22 | -t $(IMAGE) . | 23 | -t $(IMAGE) . |
23 | 24 | ||
24 | run: | 25 | 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} \ | |||
34 | /var/run/unifi \ | 34 | /var/run/unifi \ |
35 | /usr/lib/unifi/dl | 35 | /usr/lib/unifi/dl |
36 | 36 | ||
37 | ln -s /var/log/unifi /logs | ||
38 | |||
37 | # Cleanup mongodb lock file if it exists otherwise the controller will freeze | 39 | # Cleanup mongodb lock file if it exists otherwise the controller will freeze |
38 | # forever trying to start Mongo | 40 | # forever trying to start Mongo |
39 | [ -f data/db/mongod.lock ] && rm data/db/mongod.lock | 41 | [ -f data/db/mongod.lock ] && rm data/db/mongod.lock |