mirror of
https://github.com/linuxserver/docker-unifi-network-application.git
synced 2024-11-09 23:24:08 -08:00
Initial build
This commit is contained in:
parent
6217297509
commit
f1ea91d30d
22
Dockerfile
22
Dockerfile
|
@ -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/ /
|
||||||
|
|
|
@ -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/ /
|
||||||
|
|
|
@ -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. ***"
|
||||||
|
|
Loading…
Reference in a new issue