-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from kinnairdclan/nxgo-dev
Nx Go Support Closes #172
- Loading branch information
Showing
14 changed files
with
597 additions
and
68 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
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
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
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,111 @@ | ||
# Dockerfile created by CreateMatrix, do not modify by hand | ||
# Product: NxGo | ||
# Description: Nx Go VMS | ||
# Company: networkoptix | ||
# Release: nxgo | ||
# LSIO: True | ||
|
||
# https://support.networkoptix.com/hc/en-us/articles/205313168-Nx-Witness-Operating-System-Support | ||
# Latest Ubuntu supported for v5.1 is Jammy | ||
FROM lsiobase/ubuntu:jammy | ||
|
||
# Labels | ||
ARG LABEL_NAME="NxGo-LSIO" | ||
ARG LABEL_DESCRIPTION="Nx Go VMS" | ||
ARG LABEL_VERSION="6.0.0.38908" | ||
|
||
# Download URL and version | ||
# Current values are defined by the build pipeline | ||
ARG DOWNLOAD_X64_URL="https://updates.networkoptix.com/nxgo/39242/linux/nxgo-server-6.0.0.38908-linux_x64.deb" | ||
ARG DOWNLOAD_ARM64_URL="https://updates.networkoptix.com/nxgo/39242/arm/nxgo-server-6.0.0.38908-linux_arm64.deb" | ||
ARG DOWNLOAD_VERSION="6.0.0.38908" | ||
|
||
# Used for ${COMPANY_NAME} setting the server user and install directory | ||
ARG RUNTIME_NAME="networkoptix" | ||
|
||
# Global builder variables | ||
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope | ||
ARG \ | ||
# Platform of the build result. Eg linux/amd64, linux/arm/v7, windows/amd64 | ||
TARGETPLATFORM \ | ||
# Architecture component of TARGETPLATFORM | ||
TARGETARCH \ | ||
# Platform of the node performing the build | ||
BUILDPLATFORM | ||
|
||
# The RUN wget command will be cached unless we change the cache tag | ||
# Use the download version for the cache tag | ||
ARG CACHE_DATE=${DOWNLOAD_VERSION} | ||
|
||
# Prevent EULA and confirmation prompts in installers | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Media server user and directory name | ||
ENV COMPANY_NAME=${RUNTIME_NAME} | ||
|
||
# Labels | ||
LABEL name=${LABEL_NAME}-${DOWNLOAD_VERSION} \ | ||
description=${LABEL_DESCRIPTION} \ | ||
version=${LABEL_VERSION} \ | ||
maintainer="Pieter Viljoen <[email protected]>" | ||
|
||
# Install required tools and utilities | ||
RUN apt-get update \ | ||
&& apt-get upgrade --yes \ | ||
&& apt-get install --no-install-recommends --yes \ | ||
ca-certificates \ | ||
unzip \ | ||
wget | ||
|
||
# Download the installer file | ||
RUN mkdir -p /temp | ||
COPY download.sh /temp/download.sh | ||
# Set the working directory to /temp | ||
WORKDIR /temp | ||
RUN chmod +x download.sh \ | ||
&& ./download.sh | ||
|
||
# LSIO maps the host PUID and PGID environment variables to "abc" in the container. | ||
# The mediaserver calls "chown ${COMPANY_NAME}" at runtime | ||
# We have to match the ${COMPANY_NAME} username with the LSIO "abc" usernames | ||
# LSIO does not officially support changing the "abc" username | ||
# https://discourse.linuxserver.io/t/changing-abc-container-user/3208 | ||
# https://github.com/linuxserver/docker-baseimage-ubuntu/blob/jammy/root/etc/s6-overlay/s6-rc.d/init-adduser/run | ||
# Change user "abc" to ${COMPANY_NAME} | ||
RUN usermod -l ${COMPANY_NAME} abc \ | ||
# Change group "abc" to ${COMPANY_NAME} | ||
&& groupmod -n ${COMPANY_NAME} abc \ | ||
# Replace "abc" with ${COMPANY_NAME} | ||
&& sed -i "s/abc/\${COMPANY_NAME}/g" /etc/s6-overlay/s6-rc.d/init-adduser/run | ||
|
||
# Install the mediaserver and dependencies | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends --yes \ | ||
gdb \ | ||
./vms_server.deb \ | ||
# Cleanup | ||
&& apt-get clean \ | ||
&& apt-get autoremove --purge \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /temp | ||
|
||
# Set ownership permissions | ||
RUN chown --verbose ${COMPANY_NAME}:${COMPANY_NAME} /opt/${COMPANY_NAME}/mediaserver/bin \ | ||
&& chown --verbose ${COMPANY_NAME}:${COMPANY_NAME} /opt/${COMPANY_NAME}/mediaserver/bin/external.dat | ||
|
||
# Copy etc init and services files | ||
# https://github.com/just-containers/s6-overlay#container-environment | ||
# https://www.linuxserver.io/blog/how-is-container-formed | ||
COPY s6-overlay /etc/s6-overlay | ||
|
||
# Expose port 7001 | ||
EXPOSE 7001 | ||
|
||
# Create mount points | ||
# Links will be created at runtime in LSIO/etc/s6-overlay/s6-rc.d/init-nx-relocate/run | ||
# /opt/${COMPANY_NAME}/mediaserver/etc -> /config/etc | ||
# /opt/${COMPANY_NAME}/mediaserver/var -> /config/var | ||
# /root/.config/nx_ini links -> /config/ini | ||
# /config is for configuration | ||
# /media is for media recording | ||
VOLUME /config /media |
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,103 @@ | ||
# Dockerfile created by CreateMatrix, do not modify by hand | ||
# Product: NxGo | ||
# Description: Nx Go VMS | ||
# Company: networkoptix | ||
# Release: nxgo | ||
# LSIO: False | ||
|
||
# https://support.networkoptix.com/hc/en-us/articles/205313168-Nx-Witness-Operating-System-Support | ||
# Latest Ubuntu supported for v5.1 is Jammy | ||
FROM ubuntu:jammy | ||
|
||
# Labels | ||
ARG LABEL_NAME="NxGo" | ||
ARG LABEL_DESCRIPTION="Nx Go VMS" | ||
ARG LABEL_VERSION="6.0.0.38908" | ||
|
||
# Download URL and version | ||
# Current values are defined by the build pipeline | ||
ARG DOWNLOAD_X64_URL="https://updates.networkoptix.com/nxgo/39242/linux/nxgo-server-6.0.0.38908-linux_x64.deb" | ||
ARG DOWNLOAD_ARM64_URL="https://updates.networkoptix.com/nxgo/39242/arm/nxgo-server-6.0.0.38908-linux_arm64.deb" | ||
ARG DOWNLOAD_VERSION="6.0.0.38908" | ||
|
||
# Used for ${COMPANY_NAME} setting the server user and install directory | ||
ARG RUNTIME_NAME="networkoptix" | ||
|
||
# Global builder variables | ||
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope | ||
ARG \ | ||
# Platform of the build result. Eg linux/amd64, linux/arm/v7, windows/amd64 | ||
TARGETPLATFORM \ | ||
# Architecture component of TARGETPLATFORM | ||
TARGETARCH \ | ||
# Platform of the node performing the build | ||
BUILDPLATFORM | ||
|
||
# The RUN wget command will be cached unless we change the cache tag | ||
# Use the download version for the cache tag | ||
ARG CACHE_DATE=${DOWNLOAD_VERSION} | ||
|
||
# Prevent EULA and confirmation prompts in installers | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Media server user and directory name | ||
ENV COMPANY_NAME=${RUNTIME_NAME} | ||
|
||
# Labels | ||
LABEL name=${LABEL_NAME}-${DOWNLOAD_VERSION} \ | ||
description=${LABEL_DESCRIPTION} \ | ||
version=${LABEL_VERSION} \ | ||
maintainer="Pieter Viljoen <[email protected]>" | ||
|
||
# Install required tools and utilities | ||
RUN apt-get update \ | ||
&& apt-get upgrade --yes \ | ||
&& apt-get install --no-install-recommends --yes \ | ||
ca-certificates \ | ||
unzip \ | ||
wget | ||
|
||
# Download the installer file | ||
RUN mkdir -p /temp | ||
COPY download.sh /temp/download.sh | ||
# Set the working directory to /temp | ||
WORKDIR /temp | ||
RUN chmod +x download.sh \ | ||
&& ./download.sh | ||
|
||
# Install the mediaserver and dependencies | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends --yes \ | ||
gdb \ | ||
sudo \ | ||
./vms_server.deb \ | ||
# Cleanup | ||
&& apt-get clean \ | ||
&& apt-get autoremove --purge \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /temp | ||
|
||
# Add the mediaserver ${COMPANY_NAME} user to the sudoers group | ||
# Only allow sudo no password access to the root-tool | ||
RUN echo "${COMPANY_NAME} ALL = NOPASSWD: /opt/${COMPANY_NAME}/mediaserver/bin/root-tool" > /etc/sudoers.d/${COMPANY_NAME} | ||
|
||
# Copy the entrypoint.sh launch script | ||
# entrypoint.sh will run the mediaserver and root-tool | ||
COPY entrypoint.sh /opt/entrypoint.sh | ||
RUN chmod +x /opt/entrypoint.sh | ||
|
||
# Run the entrypoint as the mediaserver ${COMPANY_NAME} user | ||
# Note that this user exists in the container and does not directly map to a user on the host | ||
USER ${COMPANY_NAME} | ||
|
||
# Runs entrypoint.sh on container start | ||
ENTRYPOINT ["/opt/entrypoint.sh"] | ||
|
||
# Expose port 7001 | ||
EXPOSE 7001 | ||
|
||
# Link volumes directly, e.g. | ||
# /mnt/config/etc:opt/networkoptix/mediaserver/etc | ||
# /mnt/config/nx_ini:/home/networkoptix/.config/nx_ini | ||
# /mnt/config/var:/opt/networkoptix/mediaserver/var | ||
# /mnt/media:/media |
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
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
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
Oops, something went wrong.