diff options
author | Mike Crute <mike@crute.us> | 2023-11-21 21:19:38 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-11-21 21:19:38 -0800 |
commit | a6dcbdda8fb66393be7e12bd3a90b77c203987d1 (patch) | |
tree | 5be553d205eb689837f6a7972e46880c73681421 /unifi | |
parent | aad62a8b259005cb8353d6a7b4a3f60c85803d1f (diff) | |
download | dockerfiles-a6dcbdda8fb66393be7e12bd3a90b77c203987d1.tar.bz2 dockerfiles-a6dcbdda8fb66393be7e12bd3a90b77c203987d1.tar.xz dockerfiles-a6dcbdda8fb66393be7e12bd3a90b77c203987d1.zip |
Remove old builds
Diffstat (limited to 'unifi')
-rw-r--r-- | unifi/.dockerignore | 1 | ||||
-rw-r--r-- | unifi/Dockerfile | 60 | ||||
-rw-r--r-- | unifi/Makefile | 38 | ||||
-rw-r--r-- | unifi/log4j.properties | 25 | ||||
-rw-r--r-- | unifi/simplevisor.json | 53 | ||||
-rwxr-xr-x | unifi/unifi-setup.sh | 69 |
6 files changed, 0 insertions, 246 deletions
diff --git a/unifi/.dockerignore b/unifi/.dockerignore deleted file mode 100644 index f3c7a7c..0000000 --- a/unifi/.dockerignore +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | Makefile | ||
diff --git a/unifi/Dockerfile b/unifi/Dockerfile deleted file mode 100644 index b04fd2d..0000000 --- a/unifi/Dockerfile +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | FROM alpine:edge | ||
2 | LABEL maintainer="Mike Crute <mike@crute.us>" | ||
3 | |||
4 | # TODO: Move all the unpacking stuff to the Makefile | ||
5 | |||
6 | ARG deb_version | ||
7 | ARG checksum | ||
8 | |||
9 | ADD log4j.properties /tmp/ | ||
10 | |||
11 | RUN set -euxo pipefail; \ | ||
12 | # Validate required arguments were passed | ||
13 | test -z "${deb_version}" && { echo -e "\033[31mMissing build parameter 'deb_version'\033[39m"; exit 1; }; \ | ||
14 | test -z "${checksum}" && { echo -e "\033[31mMissing build parameter 'checksum'\033[39m"; exit 1; }; \ | ||
15 | \ | ||
16 | # Install build and run dependencies | ||
17 | apk add --no-cache --virtual .build-deps \ | ||
18 | binutils \ | ||
19 | ca-certificates \ | ||
20 | curl \ | ||
21 | && apk add --no-cache \ | ||
22 | dumb-init \ | ||
23 | java-snappy \ | ||
24 | libcap \ | ||
25 | nss \ | ||
26 | openjdk17-jre-headless \ | ||
27 | su-exec \ | ||
28 | \ | ||
29 | # Fetch the Unifi package and validate the checksum before unpacking | ||
30 | && cd /tmp \ | ||
31 | && curl -sO "https://dl.ui.com/unifi/${deb_version}/unifi_sysvinit_all.deb" \ | ||
32 | && echo "${checksum} *unifi_sysvinit_all.deb" > checksums.txt \ | ||
33 | && sha256sum -sc checksums.txt \ | ||
34 | \ | ||
35 | # Unpack the debian package and "install" it | ||
36 | && ar x unifi_sysvinit_all.deb \ | ||
37 | && tar -xJf data.tar.xz \ | ||
38 | && rm usr/lib/unifi/bin/unifi.init \ | ||
39 | && mv usr/lib/unifi /usr/lib \ | ||
40 | \ | ||
41 | # Create directories and link everything together | ||
42 | && mkdir -p /var/lib/unifi /var/log/unifi /var/run/unifi \ | ||
43 | && ln -sf /usr/bin/mongod /usr/lib/unifi/bin/mongod \ | ||
44 | && ln -sf /var/lib/unifi /usr/lib/unifi/data \ | ||
45 | && ln -sf /var/log/unifi /usr/lib/unifi/logs \ | ||
46 | && ln -sf /var/run/unifi /usr/lib/unifi/run \ | ||
47 | \ | ||
48 | # Install our customizations | ||
49 | && mv /tmp/log4j.properties /usr/lib/unifi \ | ||
50 | \ | ||
51 | # Cleanup | ||
52 | && apk del .build-deps \ | ||
53 | && rm -rf /tmp/* | ||
54 | |||
55 | ADD unifi-setup.sh / | ||
56 | ADD simplevisor.json / | ||
57 | ADD simplevisor / | ||
58 | |||
59 | STOPSIGNAL SIGTERM | ||
60 | ENTRYPOINT [ "/simplevisor" ] | ||
diff --git a/unifi/Makefile b/unifi/Makefile deleted file mode 100644 index 36f0327..0000000 --- a/unifi/Makefile +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | VERSION=8.0.7 | ||
2 | VERSION_SUFFIX=-7a3d06144a | ||
3 | VERSION_TAG=$(VERSION)-0 | ||
4 | IMAGE=docker.crute.me/unifi:$(VERSION_TAG) | ||
5 | LATEST=$(subst :$(VERSION_TAG),,$(IMAGE)):latest | ||
6 | |||
7 | DEB_VERSION="$(VERSION)$(VERSION_SUFFIX)" | ||
8 | CHECKSUM="4221d7a0f8ce66c58a4f71b70ba6f32e16310429d3fe8165bf0f47bbdb6401a6" | ||
9 | |||
10 | all: | ||
11 | docker pull alpine:latest | ||
12 | docker build \ | ||
13 | --no-cache \ | ||
14 | --build-arg=deb_version=$(DEB_VERSION) \ | ||
15 | --build-arg=checksum=$(CHECKSUM) \ | ||
16 | -t $(IMAGE) . | ||
17 | |||
18 | all-no-cache: | ||
19 | docker build \ | ||
20 | --no-cache \ | ||
21 | --build-arg=deb_version=$(DEB_VERSION) \ | ||
22 | --build-arg=checksum=$(CHECKSUM) \ | ||
23 | -t $(IMAGE) . | ||
24 | |||
25 | run: | ||
26 | docker run -d \ | ||
27 | -e UNIFI_UID=1001 \ | ||
28 | -e UNIFI_GID=1001 \ | ||
29 | -p 8080:8080 \ | ||
30 | -p 8443:8443 \ | ||
31 | $(IMAGE) | ||
32 | |||
33 | publish: | ||
34 | docker push $(IMAGE) | ||
35 | |||
36 | publish-prod: | ||
37 | docker tag $(IMAGE) $(LATEST) | ||
38 | docker push $(LATEST) | ||
diff --git a/unifi/log4j.properties b/unifi/log4j.properties deleted file mode 100644 index 643c623..0000000 --- a/unifi/log4j.properties +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | log4j.rootLogger=INFO,server_log | ||
2 | |||
3 | log4j.appender.server_log=org.apache.log4j.ConsoleAppender | ||
4 | log4j.appender.server_log.layout=org.apache.log4j.PatternLayout | ||
5 | log4j.appender.server_log.layout.ConversionPattern=[%d{ISO8601}] <%t> %-5p %-6c{1} - %m%n | ||
6 | |||
7 | log4j.logger.java=INFO | ||
8 | log4j.logger.javax=INFO | ||
9 | log4j.logger.javax.jmdns=INFO | ||
10 | log4j.logger.sun=INFO | ||
11 | log4j.logger.org.apache=INFO | ||
12 | log4j.logger.httpclient.wire=INFO | ||
13 | log4j.logger.net.schmizz=INFO | ||
14 | log4j.logger.com.codahale=INFO | ||
15 | log4j.logger.org.apache.jasper=INFO | ||
16 | log4j.logger.org.apache.tomcat=INFO | ||
17 | log4j.logger.org.apache.commons=INFO | ||
18 | log4j.logger.org.apache.catalina=INFO | ||
19 | |||
20 | log4j.logger.org.springframework=INFO | ||
21 | log4j.logger.de.javawi.jstun=INFO | ||
22 | log4j.logger.com.mongodb=INFO | ||
23 | |||
24 | log4j.logger.com.ubnt=INFO | ||
25 | log4j.logger.com.ubiquiti=INFO | ||
diff --git a/unifi/simplevisor.json b/unifi/simplevisor.json deleted file mode 100644 index 566c872..0000000 --- a/unifi/simplevisor.json +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | { | ||
2 | "env": { | ||
3 | "pass": [ | ||
4 | "PATH", | ||
5 | "HOSTNAME", | ||
6 | "SHLVL", | ||
7 | "HOME", | ||
8 | "PWD", | ||
9 | |||
10 | "UNIFI_UID", | ||
11 | "UNIFI_GID", | ||
12 | |||
13 | "MONGO_URL", | ||
14 | "MONGO_STATS_URL" | ||
15 | ], | ||
16 | "vault-replace": [ | ||
17 | "MONGO_USER", | ||
18 | "MONGO_PASSWORD" | ||
19 | ], | ||
20 | "vault-template": [ | ||
21 | "MONGO_URL", | ||
22 | "MONGO_STATS_URL" | ||
23 | ] | ||
24 | }, | ||
25 | "jobs": { | ||
26 | "init": [ | ||
27 | { | ||
28 | "cmd": ["/unifi-setup.sh"], | ||
29 | "run-as": "root" | ||
30 | } | ||
31 | ], | ||
32 | "main": [ | ||
33 | { | ||
34 | "cmd": [ | ||
35 | "/usr/lib/jvm/default-jvm/bin/java", | ||
36 | "-cp", "/usr/lib/unifi/lib/ace.jar", | ||
37 | "-Dlog4j.configuration=file:/usr/lib/unifi/log4j.properties", | ||
38 | "-Dlog4j2.formatMsgNoLookups=true", | ||
39 | "-Dunifi.datadir=/usr/lib/unifi/data", | ||
40 | "-Dunifi.logdir=/usr/lib/unifi/logs", | ||
41 | "-Dunifi.rundir=/usr/lib/unifi/run", | ||
42 | "-Xmx1024M", | ||
43 | "-Djava.awt.headless=true", | ||
44 | "-Dorg.xerial.snappy.use.systemlib=true", | ||
45 | "-Dfile.encoding=UTF-8", | ||
46 | "--add-opens=java.base/java.time=ALL-UNNAMED", | ||
47 | "com.ubnt.ace.Launcher", "start" | ||
48 | ], | ||
49 | "run-as": "unifi" | ||
50 | } | ||
51 | ] | ||
52 | } | ||
53 | } | ||
diff --git a/unifi/unifi-setup.sh b/unifi/unifi-setup.sh deleted file mode 100755 index 86153b5..0000000 --- a/unifi/unifi-setup.sh +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | USERNAME="unifi" | ||
6 | BASEDIR="/usr/lib/unifi" | ||
7 | DATA_DIR="${BASEDIR}/data" | ||
8 | |||
9 | # Default UID/GID to owner of the data directory | ||
10 | UNIFI_UID=${UNIFI_UID:-$(stat -L -c "%u" $DATA_DIR)} | ||
11 | UNIFI_GID=${UNIFI_GID:-$(stat -L -c "%u" $DATA_DIR)} | ||
12 | |||
13 | if [ "$UNIFI_GID" = 0 -o "$UNIFI_GID" = 0 ]; then | ||
14 | echo "Set UNIFI_UID and UNIFI_GID in environment" | ||
15 | exit 1 | ||
16 | else | ||
17 | echo "Unifi UID/GID: $UNIFI_UID $UNIFI_GID" | ||
18 | fi | ||
19 | |||
20 | cd ${BASEDIR} | ||
21 | |||
22 | # Create the user and group | ||
23 | if ! getent group ${USERNAME} > /dev/null 2>&1; then | ||
24 | addgroup -g ${UNIFI_GID} -S ${USERNAME} | ||
25 | fi | ||
26 | if ! getent passwd ${USERNAME} > /dev/null 2>&1; then | ||
27 | adduser -u ${UNIFI_UID} -S -h /var/lib/${USERNAME} -H -D -G ${USERNAME} ${USERNAME} | ||
28 | fi | ||
29 | |||
30 | # Update permissions on the root directories | ||
31 | chown -R ${USERNAME}:${USERNAME} \ | ||
32 | /var/lib/unifi \ | ||
33 | /var/log/unifi \ | ||
34 | /var/run/unifi \ | ||
35 | /usr/lib/unifi/dl | ||
36 | |||
37 | ln -s /var/log/unifi /logs | ||
38 | |||
39 | # Cleanup mongodb lock file if it exists otherwise the controller will freeze | ||
40 | # forever trying to start Mongo | ||
41 | [ -f data/db/mongod.lock ] && rm data/db/mongod.lock | ||
42 | |||
43 | if [ -n "$MONGO_URL" ]; then | ||
44 | echo "Using external mongodb instance" | ||
45 | echo "db.mongo.local=false" >> /var/lib/unifi/system.properties | ||
46 | echo "db.mongo.uri=${MONGO_URL}" >> /var/lib/unifi/system.properties | ||
47 | echo "statdb.mongo.uri=${MONGO_STATS_URL}" >> /var/lib/unifi/system.properties | ||
48 | echo "unifi.db.name=${MONGO_DB_NAME:-ace}" >> /var/lib/unifi/system.properties | ||
49 | echo "statdb.db.name=${MONGO_STATS_DB_NAME:-ace_stat}" >> /var/lib/unifi/system.properties | ||
50 | fi | ||
51 | |||
52 | # If this is set that the controller will start with no settings and will run | ||
53 | # the setup. | ||
54 | # | ||
55 | # WARNING! If this is set on a live database then the controller will delete | ||
56 | # all data and start fresh. | ||
57 | if [ -z "$START_DEFAULT" ]; then | ||
58 | echo "is_default=false" >> /var/lib/unifi/system.properties | ||
59 | fi | ||
60 | |||
61 | # Replace the current process with a scoped-down controller. The java app | ||
62 | # is designed to do its own job control but it has to run with an init | ||
63 | # system or it doesn't get the signals from docker. | ||
64 | # | ||
65 | # Use the snappy native library installed with apk because the bundled on | ||
66 | # is built against libc which is not available in Alpine. Without this | ||
67 | # inform will fail with a decompression library error. | ||
68 | |||
69 | # NOTE: This has been migrated to simplevisor.json | ||