2023-09-05 09:07:14 -07:00
|
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
2023-11-21 11:58:00 -08:00
|
|
|
|
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
|
2023-09-05 09:07:14 -07:00
|
|
|
|
|
|
|
|
|
# set version label
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
|
ARG VERSION
|
|
|
|
|
ARG UNIFI_VERSION
|
|
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
|
|
|
|
LABEL maintainer="thespad"
|
|
|
|
|
|
|
|
|
|
# environment settings
|
2024-02-24 10:36:36 -08:00
|
|
|
|
ARG UNIFI_BRANCH="stable"
|
2024-02-24 09:31:12 -08:00
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
2023-09-05 09:07:14 -07:00
|
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
|
echo "**** install packages ****" && \
|
2023-11-21 11:58:00 -08:00
|
|
|
|
apt-get update && \
|
|
|
|
|
apt-get install --no-install-recommends -y \
|
2023-09-05 09:07:14 -07:00
|
|
|
|
jsvc \
|
|
|
|
|
logrotate \
|
2023-11-21 11:58:00 -08:00
|
|
|
|
openjdk-17-jre-headless \
|
|
|
|
|
unzip && \
|
2023-09-05 09:07:14 -07:00
|
|
|
|
echo "**** install unifi ****" && \
|
|
|
|
|
if [ -z ${UNIFI_VERSION+x} ]; then \
|
2024-02-24 09:30:48 -08:00
|
|
|
|
UNIFI_VERSION=$(curl -sX GET https://dl.ui.com/unifi/debian/dists/${UNIFI_BRANCH}/ubiquiti/binary-amd64/Packages \
|
2023-09-05 09:07:14 -07:00
|
|
|
|
|grep -A 7 -m 1 'Package: unifi' \
|
|
|
|
|
| awk -F ': ' '/Version/{print $2;exit}' \
|
|
|
|
|
| awk -F '-' '{print $1}'); \
|
|
|
|
|
fi && \
|
|
|
|
|
mkdir -p /app && \
|
|
|
|
|
curl -o \
|
2023-11-16 01:08:59 -08:00
|
|
|
|
/tmp/unifi.zip -L \
|
|
|
|
|
"https://dl.ui.com/unifi/${UNIFI_VERSION}/UniFi.unix.zip" && \
|
|
|
|
|
unzip /tmp/unifi.zip -d /usr/lib && \
|
|
|
|
|
mv /usr/lib/UniFi /usr/lib/unifi && \
|
2023-09-05 09:07:14 -07:00
|
|
|
|
echo "**** cleanup ****" && \
|
2023-11-21 11:58:00 -08:00
|
|
|
|
apt-get clean && \
|
2023-09-05 09:07:14 -07:00
|
|
|
|
rm -rf \
|
2023-11-21 11:58:00 -08:00
|
|
|
|
/tmp/* \
|
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
|
/var/tmp/*
|
2023-09-05 09:07:14 -07:00
|
|
|
|
|
|
|
|
|
# add local files
|
|
|
|
|
COPY root/ /
|
|
|
|
|
|
|
|
|
|
# Volumes and Ports
|
|
|
|
|
WORKDIR /usr/lib/unifi
|
|
|
|
|
VOLUME /config
|
|
|
|
|
EXPOSE 8080 8443 8843 8880
|