-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 397be65
Showing
5 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Set line endings to LF for scripts | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Docker CI | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure Docker | ||
env: | ||
DOCKER_USER: ${{secrets.DOCKER_USER}} | ||
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_TOKEN | ||
- name: Build 22.04 | ||
run: | | ||
UNIFI_VERSION=$(wget --quiet --no-cookies https://dl.ui.com/unifi/debian/dists/stable/ubiquiti/binary-amd64/Packages -O - | sed -n 's/Version: //p') | ||
docker build . --pull --build-arg OCIE_VERSION=22.04 UNIFI_VERSION=$UNIFI_VERSION --tag bshp/unifi:latest --no-cache | ||
- name: Push 22.04 | ||
run: | | ||
docker tag bshp/unifi:latest bshp/unifi:$UNIFI_VERSION | ||
docker push bshp/unifi:latest | ||
docker push bshp/unifi:$UNIFI_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.log | ||
.build | ||
*.tar | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Ocie Version, e.g 22.04 unquoted | ||
ARG OCIE_VERSION | ||
|
||
ARG UNIFI_VERSION="" | ||
|
||
FROM bshp/ocie:${OCIE_VERSION} | ||
|
||
ARG UNIFI_VERSION | ||
|
||
# Ocie | ||
ENV OCIE_CONFIG=/etc/unifi \ | ||
APP_GROUP="root" \ | ||
APP_OWNER="root" \ | ||
APP_DATA=/opt/data \ | ||
APP_HOME=/usr/lib/unifi \ | ||
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 \ | ||
UNIFI_VERSION=${UNIFI_VERSION} | ||
|
||
RUN <<"EOD" bash | ||
set -eux; | ||
# Source environment for OS_CODENAME | ||
. /etc/environment; | ||
# Add MongoDB Repo | ||
wget --quiet "https://www.mongodb.org/static/pgp/server-7.0.asc" -O- | gpg --dearmor -o /usr/share/keyrings/mongodb.gpg; | ||
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg] https://repo.mongodb.org/apt/ubuntu ${OS_CODENAME}/mongodb-org/7.0 multiverse" \ | ||
| tee /etc/apt/sources.list.d/mongodb-org-7.0.list; | ||
# Setup system | ||
ocie --pkg "-add binutils,mongodb-org,libcap2,logrotate,openjdk-17-jre-headless"; | ||
if [[ -z "${UNIFI_VERSION}" ]];then | ||
UNIFI_VERSION=$(wget --quiet --no-cookies https://dl.ui.com/unifi/debian/dists/stable/ubiquiti/binary-amd64/Packages -O - | sed -n 's/Version: //p'); | ||
fi; | ||
wget --quiet --no-cookies https://dl.ui.com/unifi/${UNIFI_VERSION%%-*}/UniFi.unix.zip -O /tmp/unifi.zip; | ||
unzip -qq /tmp/unifi.zip -d /usr/lib/ && mv /usr/lib/UniFi ${APP_HOME}; | ||
install -d -m 0755 -o root -g root ${APP_DATA}; | ||
ln -s ${APP_DATA} ${APP_HOME}/; | ||
# Cleanup image, remove unused directories and files, etc.. | ||
ocie --clean "-base -path /tmp/ -pattern '*.zip'"; | ||
EOD | ||
|
||
COPY --chown=root:root --chmod=0755 ./src/ ./ | ||
|
||
ENTRYPOINT ["/usr/sbin/ociectl", "--run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
APP_VOLS="/opt/data"; | ||
|
||
function app_shutdown() | ||
{ | ||
/usr/bin/java -jar ${APP_HOME}/lib/ace.jar stop | ||
} | ||
|
||
function app_reload() | ||
{ | ||
app_shutdown; | ||
app_start; | ||
} | ||
|
||
function app_start() | ||
{ | ||
/usr/bin/java -Dlog4j2.formatMsgNoLookups=true \ | ||
-Dunifi.datadir=/opt/data \ | ||
-Dfile.encoding=UTF-8 \ | ||
-Djava.awt.headless=true \ | ||
-Dapple.awt.UIElement=true \ | ||
-XX:+UseParallelGC \ | ||
-XX:+ExitOnOutOfMemoryError \ | ||
-XX:+CrashOnOutOfMemoryError \ | ||
--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 \ | ||
-jar ${APP_HOME}/lib/ace.jar start | ||
} | ||
|
||
function app_certs() | ||
{ | ||
${OCIE_LIB}/cacerts; | ||
} |