Initial build

This commit is contained in:
TheSpad 2023-11-16 09:08:59 +00:00
parent 6217297509
commit f1ea91d30d
No known key found for this signature in database
GPG key ID: 08F06191F4587860
3 changed files with 24 additions and 28 deletions

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy FROM ghcr.io/linuxserver/baseimage-alpine:3.18
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -11,17 +11,13 @@ LABEL maintainer="thespad"
# environment settings # environment settings
ARG UNIFI_BRANCH="stable" ARG UNIFI_BRANCH="stable"
ARG DEBIAN_FRONTEND="noninteractive"
RUN \ RUN \
echo "**** install packages ****" && \ echo "**** install packages ****" && \
apt-get update && \ apk add --no-cache \
apt-get install -y --no-install-recommends \
binutils \
jsvc \ jsvc \
libcap2 \
logrotate \ logrotate \
openjdk-17-jre-headless && \ openjdk17-jre-headless && \
echo "**** install unifi ****" && \ echo "**** install unifi ****" && \
if [ -z ${UNIFI_VERSION+x} ]; then \ if [ -z ${UNIFI_VERSION+x} ]; then \
UNIFI_VERSION=$(curl -sX GET http://dl.ui.com/unifi/debian/dists/${UNIFI_BRANCH}/ubiquiti/binary-amd64/Packages \ UNIFI_VERSION=$(curl -sX GET http://dl.ui.com/unifi/debian/dists/${UNIFI_BRANCH}/ubiquiti/binary-amd64/Packages \
@ -31,15 +27,13 @@ RUN \
fi && \ fi && \
mkdir -p /app && \ mkdir -p /app && \
curl -o \ curl -o \
/tmp/unifi.deb -L \ /tmp/unifi.zip -L \
"https://dl.ui.com/unifi/${UNIFI_VERSION}/unifi_sysvinit_all.deb" && \ "https://dl.ui.com/unifi/${UNIFI_VERSION}/UniFi.unix.zip" && \
dpkg -i --ignore-depends=mongodb-org-server /tmp/unifi.deb && \ unzip /tmp/unifi.zip -d /usr/lib && \
mv /usr/lib/UniFi /usr/lib/unifi && \
echo "**** cleanup ****" && \ echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \ rm -rf \
/tmp/* \ /tmp/*
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY root/ / COPY root/ /

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.18
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
@ -11,17 +11,13 @@ LABEL maintainer="thespad"
# environment settings # environment settings
ARG UNIFI_BRANCH="stable" ARG UNIFI_BRANCH="stable"
ARG DEBIAN_FRONTEND="noninteractive"
RUN \ RUN \
echo "**** install packages ****" && \ echo "**** install packages ****" && \
apt-get update && \ apk add --no-cache \
apt-get install -y --no-install-recommends \
binutils \
jsvc \ jsvc \
libcap2 \
logrotate \ logrotate \
openjdk-17-jre-headless && \ openjdk17-jre-headless && \
echo "**** install unifi ****" && \ echo "**** install unifi ****" && \
if [ -z ${UNIFI_VERSION+x} ]; then \ if [ -z ${UNIFI_VERSION+x} ]; then \
UNIFI_VERSION=$(curl -sX GET http://dl.ui.com/unifi/debian/dists/${UNIFI_BRANCH}/ubiquiti/binary-amd64/Packages \ UNIFI_VERSION=$(curl -sX GET http://dl.ui.com/unifi/debian/dists/${UNIFI_BRANCH}/ubiquiti/binary-amd64/Packages \
@ -31,15 +27,13 @@ RUN \
fi && \ fi && \
mkdir -p /app && \ mkdir -p /app && \
curl -o \ curl -o \
/tmp/unifi.deb -L \ /tmp/unifi.zip -L \
"https://dl.ui.com/unifi/${UNIFI_VERSION}/unifi_sysvinit_all.deb" && \ "https://dl.ui.com/unifi/${UNIFI_VERSION}/UniFi.unix.zip" && \
dpkg -i --ignore-depends=mongodb-org-server /tmp/unifi.deb && \ unzip /tmp/unifi.zip -d /usr/lib && \
mv /usr/lib/UniFi /usr/lib/unifi && \
echo "**** cleanup ****" && \ echo "**** cleanup ****" && \
apt-get clean && \
rm -rf \ rm -rf \
/tmp/* \ /tmp/*
/var/lib/apt/lists/* \
/var/tmp/*
# add local files # add local files
COPY root/ / COPY root/ /

View file

@ -3,6 +3,7 @@
# create our folders # create our folders
mkdir -p \ mkdir -p \
/run/unifi/work/ROOT \
/config/{data,logs} /config/{data,logs}
# create symlinks for config # create symlinks for config
@ -19,6 +20,13 @@ for i in "${symlinks[@]}"; do
fi fi
done done
if [[ -L "/usr/lib/unifi/run" && ! "/usr/lib/unifi/run" -ef "/run/unifi" ]]; then
unlink "/usr/lib/unifi/run"
fi
if [[ ! -L "/usr/lib/unifi/run" ]]; then
ln -s "/run/unifi" "/usr/lib/unifi/run"
fi
if [[ ! -e /config/data/system.properties ]]; then if [[ ! -e /config/data/system.properties ]]; then
if [[ -z "${MONGO_HOST}" ]]; then if [[ -z "${MONGO_HOST}" ]]; then
echo "*** No MONGO_HOST set, cannot configure database settings. ***" echo "*** No MONGO_HOST set, cannot configure database settings. ***"