Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CreateMatrix/Dockerfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ RUN apt-get update \
&& chown --verbose ${COMPANY_NAME}:${COMPANY_NAME} /opt/${COMPANY_NAME}/mediaserver/bin/external.dat

""";
// Note: for LSIO, currentOsVariantOverride=docker is injected at runtime by
// s6-overlay/s6-rc.d/init-nx-relocate/run, because LSIO replaces
// /opt/${COMPANY_NAME}/mediaserver/etc with a symlink to /config/etc on first
// start, which would erase any build-time edit to the directory.
}
else
{
Expand All @@ -312,6 +316,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

""";
}

Expand Down
4 changes: 4 additions & 0 deletions Docker/DWSpectrum.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

# Copy the entrypoint.sh launch script
# entrypoint.sh will run the mediaserver and root-tool
COPY entrypoint.sh /opt/entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions Docker/NxGo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

# Copy the entrypoint.sh launch script
# entrypoint.sh will run the mediaserver and root-tool
COPY entrypoint.sh /opt/entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions Docker/NxMeta.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

# Copy the entrypoint.sh launch script
# entrypoint.sh will run the mediaserver and root-tool
COPY entrypoint.sh /opt/entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions Docker/NxWitness.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

# Copy the entrypoint.sh launch script
# entrypoint.sh will run the mediaserver and root-tool
COPY entrypoint.sh /opt/entrypoint.sh
Expand Down
4 changes: 4 additions & 0 deletions Docker/WisenetWAVE.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ RUN apt-get update \
# 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}

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
RUN echo "currentOsVariantOverride=docker" >> /opt/${COMPANY_NAME}/mediaserver/etc/mediaserver.conf

# Copy the entrypoint.sh launch script
# entrypoint.sh will run the mediaserver and root-tool
COPY entrypoint.sh /opt/entrypoint.sh
Expand Down
12 changes: 12 additions & 0 deletions Docker/s6-overlay/s6-rc.d/init-nx-relocate/run
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,15 @@ then
echo "../mediaserver/var/data exists, deleting"
rm /opt/${COMPANY_NAME}/mediaserver/var/data
fi

# Tell mediaserver it is running under Docker so it reports its OS variant correctly
# https://github.com/networkoptix/nxvms-docker/commit/54bbd16
# Inject at runtime rather than build time because the etc directory above is replaced
# by a symlink to /config/etc on first start, which would erase any build-time edit.
MEDIASERVER_CONF="/config/etc/mediaserver.conf"
if ! grep -q "^currentOsVariantOverride=docker" "${MEDIASERVER_CONF}" 2>/dev/null
then
echo "Adding currentOsVariantOverride=docker to ${MEDIASERVER_CONF}"
echo "currentOsVariantOverride=docker" >> "${MEDIASERVER_CONF}"
chown ${COMPANY_NAME}:${COMPANY_NAME} "${MEDIASERVER_CONF}"
fi
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ services:
- test_nxwitness-lsio_media:/media
- test_nxwitness-lsio_backup:/backup
- test_nxwitness-lsio_analytics:/analytics
tmpfs:
# Keep mediaserver's unix socket and tmp files in RAM
- /tmp:size=1g,mode=1777
```

```shell
Expand Down Expand Up @@ -93,15 +96,19 @@ services:
security_opt: # Set with care
- seccomp=unconfined
- apparmor=unconfined
devices: # Pass through Intel/AMD iGPU for hardware accelerated video
- /dev/dri
environment:
- TZ=${TZ}
- PUID=${USER_NONROOT_ID} # Run as non-root user
- PGID=${USERS_GROUP_ID}
volumes: # ZFS volumes
- ${APPDATA_DIR}/nxmeta/config:/config
- ${NVR_DIR}/media:/media
- ${NVR_DIR}/backup:/backup
- ${NVR_DIR}/analytics:/analytics
- ${NVR_DIR}/media:/media # ssdpool/nvr-media
- ${NVR_DIR}/backup:/backup # hddpool/nvr-backup
- ${NVR_DIR}/analytics:/analytics # ssdpool/nvr-analytics
tmpfs: # Keep mediaserver's unix socket and tmp files in RAM
- /tmp:size=1g,mode=1777
networks:
public_network:
ipv4_address: ${NXMETA_IP} # Static IP
Expand All @@ -110,7 +117,7 @@ services:
stack_network:
labels:
- traefik.enable=true # Traefik SSL proxy
- traefik.http.routers.nxmeta.rule=HostRegexp(`^nxmeta${DOMAIN_REGEX}$$`)
- traefik.http.routers.nxmeta.rule=HostRegexp(`^nxmeta-web${DOMAIN_REGEX}$$`)
- traefik.http.services.nxmeta.loadbalancer.server.scheme=https
- traefik.http.services.nxmeta.loadbalancer.server.port=7001
```
Expand Down Expand Up @@ -361,6 +368,9 @@ services:
volumes:
- /mnt/nxwitness/config:/config
- /mnt/nxwitness/media:/media
tmpfs:
# Keep mediaserver's unix socket and tmp files in RAM
- /tmp:size=1g,mode=1777
```

### Non-LSIO Docker Compose
Expand All @@ -377,6 +387,9 @@ services:
- /mnt/nxwitness/config/nx_ini:/home/networkoptix/.config/nx_ini
- /mnt/nxwitness/config/var:/opt/networkoptix/mediaserver/var
- /mnt/nxwitness/media:/media
tmpfs:
# Keep mediaserver's unix socket and tmp files in RAM
- /tmp:size=1g,mode=1777
```

### Unraid Template
Expand Down Expand Up @@ -450,6 +463,7 @@ services:
- Camera recording license keys are activated and bound to hardware attributes of the host server collected by the `root-tool` that is required to run as `root`.
- Requiring the `root-tool` to run as root overly complicates running the `mediaserver` as a non-root user, and requires the container to run using `host` networking to not break the hardware license checks.
- Docker containers are supposed to be portable, and moving containers between hosts will break license activation.
- Nx's own [`nxvms-docker`][nxgithubcompose-link] reference image [recently disabled `root-tool`](https://github.com/networkoptix/nxvms-docker/commit/4285f93) by setting `ignoreRootTool=true` in `mediaserver.conf` and dropping their separate `root-tool` container. This trades hardware-ID license enforcement for a simpler unprivileged container. NxWitness does **not** follow this change — licensed deployments would lose activation — and will revisit only if Nx publishes a clearer official position on Docker licensing without `root-tool`.
- Nx to fix: Associate licenses with the [Cloud Account][nxcloud-link] not the local hardware.
- Storage Management:
- The mediaserver attempts to automatically decide what storage to use.
Expand Down