Skip to content

Commit

Permalink
Create 8.2/beta, v8.2.87 - Set latest-beta, etc. tags to 8.2/beta - A…
Browse files Browse the repository at this point in the history
…rchive 8.0 folders and workflows
  • Loading branch information
goofball222 committed May 20, 2024
1 parent c749ae6 commit 3ea0d1d
Show file tree
Hide file tree
Showing 52 changed files with 1,134 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build-8.1-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-alpine-beta
type=raw,8.1-alpine-beta
labels: |
org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com
Expand All @@ -45,7 +44,6 @@ jobs:
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-debian-beta
type=raw,8.1-debian-beta
labels: |
org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com
Expand All @@ -61,8 +59,6 @@ jobs:
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-beta
type=raw,latest-ubuntu-beta
type=raw,8.1-beta
type=raw,8.1-ubuntu-beta
labels: |
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/build-8.2-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Build 8.2 Beta

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 8.2/beta/**
- .github/workflows/build-8.2-beta.yml

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up dynamic build ARGs
id: getargs
run: echo "version=$(cat ./8.2/beta/VERSION)" >> $GITHUB_OUTPUT
-
name: Set up Docker metadata for Alpine
id: meta-alpine
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-alpine-beta
type=raw,8.2-alpine-beta
labels: |
org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com
org.opencontainers.image.title=UniFi Controller
org.opencontainers.image.description=UniFi Controller
org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Alpine
-
name: Set up Docker metadata for Debian
id: meta-debian
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-debian-beta
type=raw,8.2-debian-beta
labels: |
org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com
org.opencontainers.image.title=UniFi Controller
org.opencontainers.image.description=UniFi Controller
org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Debian
-
name: Set up Docker metadata for Ubuntu
id: meta-ubuntu
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,latest-beta
type=raw,latest-ubuntu-beta
type=raw,8.2-beta
type=raw,8.2-ubuntu-beta
labels: |
org.opencontainers.image.vendor=The Goofball - goofball222@gmail.com
org.opencontainers.image.title=UniFi Controller
org.opencontainers.image.description=UniFi Controller
org.opencontainers.image.version=${{ steps.getargs.outputs.version }}-Ubuntu
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Alpine Docker image
uses: docker/build-push-action@v5
with:
context: ./8.2/beta
file: ./8.2/beta/Dockerfile.alpine
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-alpine.outputs.tags }}
labels: ${{ steps.meta-alpine.outputs.labels }}
build-args: VERSION=${{ steps.getargs.outputs.version }}
-
name: Build and push Debian Docker image
uses: docker/build-push-action@v5
with:
context: ./8.2/beta
file: ./8.2/beta/Dockerfile.debian
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-debian.outputs.tags }}
labels: ${{ steps.meta-debian.outputs.labels }}
build-args: VERSION=${{ steps.getargs.outputs.version }}
-
name: Build and push Ubuntu Docker image
uses: docker/build-push-action@v5
with:
context: ./8.2/beta
file: ./8.2/beta/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-ubuntu.outputs.tags }}
labels: ${{ steps.meta-ubuntu.outputs.labels }}
build-args: VERSION=${{ steps.getargs.outputs.version }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions 8.2/beta/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.2.87-54321d7713
File renamed without changes.
File renamed without changes.
127 changes: 127 additions & 0 deletions 8.2/beta/root/usr/local/bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#!/usr/bin/env bash

# docker-entrypoint.sh script for UniFi Docker container
# License: Apache-2.0
# Github: https://github.com/goofball222/unifi
SCRIPT_VERSION="1.1.3"
# Last updated date: 2024-03-01

set -Eeuo pipefail

if [ "${DEBUG}" == 'true' ]; then
set -x
LOGSTDOUT="true"
fi

. /usr/local/bin/entrypoint-functions.sh

BASEDIR="/usr/lib/unifi"
CERTDIR=${BASEDIR}/cert
DATADIR=${BASEDIR}/data
LOGDIR=${BASEDIR}/logs
RUNDIR=${BASEDIR}/run

LOGSTDOUT=${LOGSTDOUT:-"false"}
READENV=${READENV:-"true"}

f_log "INFO - Entrypoint script version ${SCRIPT_VERSION}"
f_log "INFO - Entrypoint functions version ${ENTRYPOINT_FUNCTIONS_VERSION}"

[ ! -z "${JVM_MAX_HEAP_SIZE}" ] && JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Xmx${JVM_MAX_HEAP_SIZE}"
[ ! -z "${JVM_INIT_HEAP_SIZE}" ] && JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Xms${JVM_INIT_HEAP_SIZE}"

JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Dunifi.datadir=${DATADIR} -Dunifi.logdir=${LOGDIR} -Dunifi.rundir=${RUNDIR}"

JVM_OPTS="${JVM_EXTRA_OPTS} -Djava.awt.headless=true -Dfile.encoding=UTF-8 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED"

cd ${BASEDIR}

f_exit_handler() {
f_log "INFO - Exit signal received, commencing shutdown"
exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar stop &
for i in `seq 0 25`; do
[ -z "$(pgrep -f ${BASEDIR}/lib/ace.jar)" ] && break
# graceful shutdown
[ $i -gt 0 ] && [ -d ${RUNDIR} ] && touch ${RUNDIR}/server.stop || true
# savage shutdown
[ $i -gt 19 ] && pkill -f ${BASEDIR}/lib/ace.jar || true
sleep 1
done
f_log "INFO - Shutdown complete. Nothing more to see here. Have a nice day!"
f_log "INFO - Exit with status code ${?}"
exit ${?};
}

f_idle_handler() {
if [ "$LOGSTDOUT" = 'true' ]; then
while true
do
tail -f /dev/null & wait ${!}
done
else
while true
do
tail -F -n0 ${LOGDIR}/server.log & wait ${!}
done
fi
}

trap 'kill ${!}; f_exit_handler' SIGHUP SIGINT SIGQUIT SIGTERM

if [ "$(id -u)" = '0' ]; then
f_log "INFO - Entrypoint running with UID 0 (root)"
if [[ "${@}" == 'unifi' ]]; then
f_giduid
f_mongo
f_sysprop
f_ssl
f_bindpriv
f_chown
if [ "${RUNAS_UID0}" == 'true' ]; then
f_log "INFO - RUNAS_UID0=true - running UniFi processes as UID 0 (root)"
f_log "WARN - ======================================================================"
f_log "WARN - *** Running as UID 0 (root) is an insecure configuration ***"
f_log "WARN - ======================================================================"
f_log "EXEC - /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start"
exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start &
f_idle_handler
else
if [ -x "/sbin/su-exec" ]; then
f_log "INFO - Use su-exec to drop privileges and start Java/UniFi as GID=${PGID}, UID=${PUID}"
f_log "EXEC - su-exec unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start"
exec su-exec unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start &
f_idle_handler
elif [ -x "/usr/sbin/gosu" ]; then
f_log "INFO - Use gosu to drop privileges and start Java/UniFi as GID=${PGID}, UID=${PUID}"
f_log "EXEC - gosu unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start"
exec gosu unifi:unifi /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start &
f_idle_handler
else
f_log "ERROR - su-exec/gosu NOT FOUND. Run state is invalid. Exiting."
exit 1;
fi
fi
else
f_log "EXEC - ${@} as UID 0 (root)"
exec "${@}"
fi
else
f_log "WARN - Container/entrypoint not started as UID 0 (root)"
f_log "WARN - Unable to change permissions or set custom GID/UID if configured"
f_log "WARN - Process will be spawned with GID=$(id -g), UID=$(id -u)"
f_log "WARN - Depending on permissions requested command may not work"
if [[ "${@}" == 'unifi' ]]; then
f_mongo
f_sysprop
f_ssl
f_log "EXEC - /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start"
exec /usr/bin/java ${JVM_OPTS} -jar ${BASEDIR}/lib/ace.jar start &
f_idle_handler
else
f_log "EXEC - ${@}"
exec "${@}"
fi
fi

# Script should never make it here, but just in case exit with a generic error code if it does
exit 1;
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* **2024-05-20:**
* Create 8.2/beta, v[8.2.87](https://community.ui.com/releases/UniFi-Network-Application-8-2-87/39312132-e885-4ec3-98e7-33594d08717d)
* Set latest-beta, etc. tags to 8.2/beta
* Archive 8.0 folders and workflows
---
* **2024-05-03:**
* Update 8.1/official to v[8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561)
* Tag 8.1.127 release
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
| Tag | UniFi Version | Description | Release Date |
| --- | :---: | --- | :---: |
| [8.1, 8.1-alpine, 8.1-debian, 8.1-ubuntu, latest, latest-alpine, latest-debian, latest-ubuntu](https://github.com/goofball222/unifi/blob/main/8.1/official/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561) | UniFi Network Application official release | 2024-04-29 |
| [8.1-beta, 8.1-alpine-beta, 8.1-debian-beta, 8.1-ubuntu-beta, latest-beta, latest-alpine-beta, latest-debian-beta, latest-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.1/beta/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/dbc88c3a-a3e6-4f7d-8275-76bb40db14fd) | UniFi Network Application beta/release candidate | 2024-04-18 |
| [8.0, 8.0-alpine, 8.0-debian, 8.0-ubuntu](https://github.com/goofball222/unifi/blob/main/8.0/official/Dockerfile) | [8.0.28](https://community.ui.com/releases/UniFi-Network-Application-8-0-28/f7492865-778d-4539-aaf8-3fb09c4279b0) | UniFi Network Application official release | 2024-01-25 |
| [8.2-beta, 8.2-alpine-beta, 8.2-debian-beta, 8.2-ubuntu-beta, latest-beta, latest-alpine-beta, latest-debian-beta, latest-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.2/beta/Dockerfile) | [8.2.87](https://community.ui.com/releases/UniFi-Network-Application-8-2-87/39312132-e885-4ec3-98e7-33594d08717d) | UniFi Network Application beta/release candidate | 2024-05-20 |
| [8.1-beta, 8.1-alpine-beta, 8.1-debian-beta, 8.1-ubuntu-beta](https://github.com/goofball222/unifi/blob/main/8.1/beta/Dockerfile) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/dbc88c3a-a3e6-4f7d-8275-76bb40db14fd) | UniFi Network Application beta/release candidate | 2024-04-18 |
| [8.1.127](https://github.com/goofball222/unifi/releases/tag/8.1.127) | [8.1.127](https://community.ui.com/releases/UniFi-Network-Application-8-1-127/571d2218-216c-4769-a292-796cff379561) | Static official release tag/image | 2024-05-03 |
| [8.0.28](https://github.com/goofball222/unifi/releases/tag/8.0.28) | [8.0.28](https://community.ui.com/releases/UniFi-Network-Application-8-0-28/f7492865-778d-4539-aaf8-3fb09c4279b0) | Static official release tag/image | 2024-01-25 |
| [7.5.187](https://github.com/goofball222/unifi/releases/tag/7.5.187) | [7.5.187](https://community.ui.com/releases/UniFi-Network-Application-7-5-187/408b64c5-a485-4a37-843c-31e87140be64) | Static official release tag/image | 2023-10-17 |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions archive/8.0/beta/Dockerfile.debian.mongodb4
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
FROM debian:bullseye-slim

ARG BUILD_DATE
ARG VCS_REF
ARG VERSION

LABEL \
org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \
org.opencontainers.image.url="https://github.com/goofball222/unifi" \
org.opencontainers.image.title="UniFi Controller" \
org.opencontainers.image.description="UniFi Controller" \
org.opencontainers.image.version=${VERSION}-Debian \
org.opencontainers.image.source="https://github.com/goofball222/unifi" \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.licenses="Apache-2.0"

ENV \
BIND_PRIV=false \
DEBIAN_FRONTEND=noninteractive \
DEBUG=false \
JVM_EXTRA_OPTS= \
JVM_INIT_HEAP_SIZE= \
JVM_MAX_HEAP_SIZE=1024M \
PGID=999 \
PUID=999 \
RUN_CHOWN=true \
RUNAS_UID0=false

WORKDIR /usr/lib/unifi

COPY root /

RUN set -x \
&& groupadd -r unifi -g $PGID \
&& useradd --no-log-init -r -u $PUID -g $PGID unifi \
&& mkdir -p /usr/share/man/man1 \
&& apt-get -qqy update \
&& apt-get -qqy install apt-utils \
&& apt-get -qqy --no-install-recommends install \
dirmngr gnupg2 > /dev/null \
&& apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
binutils curl gosu \
libcap2 libcap2-bin procps > /dev/null \
&& apt-get -qqy --no-install-recommends install \
ca-certificates-java > /dev/null \
&& apt-get -qqy --no-install-recommends install \
openjdk-17-jre-headless > /dev/null \
&& curl -fsSL https://www.mongodb.org/static/pgp/server-4.0.asc | \
apt-key add - \
&& echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" \
> /etc/apt/sources.list.d/mongodb-org-4.0.list \
&& apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
mongodb-org-server > /dev/null \
&& curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \
&& apt-get -qqy purge \
apt-utils dirmngr gnupg2 > /dev/null \
&& apt-get -qqy autoremove --purge > /dev/null \
&& apt-get -qqy clean autoclean > /dev/null \
&& dpkg --force-all -i /tmp/unifi-${VERSION}.deb \
&& rm -rf data logs run \
&& bash -c 'mkdir -p {data,logs,run,cert}' \
&& chown -R unifi:unifi /usr/lib/unifi \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*

EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp

VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"]

HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["unifi"]

0 comments on commit 3ea0d1d

Please sign in to comment.