diff options
Diffstat (limited to 'unifi/Dockerfile')
-rw-r--r-- | unifi/Dockerfile | 60 |
1 files changed, 0 insertions, 60 deletions
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" ] | ||