mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-10 15:39:07 +02:00
[relay] Align the UBI image with the shared UBI pattern
Main now ships UBI variants of the client, combined server and proxy that share one license collector and one image layout, and the Red Hat certification workflow expects every certified image to carry both amd64 and arm64. The relay variant predated that, kept its own copy of the license script, built amd64 only, and ran as UID 65532 on the privileged default port :443, so it would not start under OpenShift or rootless Podman. Use release_files/collect-licenses.sh and build amd64 and arm64 like the other UBI images. Run as 1000:0 with a group-0 writable /var/lib/netbird for Let's Encrypt data, and default the listener to :8443 so an arbitrary non-root UID can bind it; the relay's Let's Encrypt flow uses TLS-ALPN on that same listener, so no separate challenge port is needed.
This commit is contained in:
+18
-8
@@ -9,15 +9,25 @@ LABEL name="netbird-relay" \
|
||||
vendor="NetBird GmbH" \
|
||||
version="${VERSION}" \
|
||||
release="${RELEASE}" \
|
||||
summary="NetBird Relay server" \
|
||||
description="NetBird Relay carries traffic when a direct peer connection is unavailable."
|
||||
summary="NetBird Relay" \
|
||||
description="NetBird Relay carries traffic between peers when a direct connection is unavailable."
|
||||
|
||||
COPY --chmod=0555 ${TARGETPLATFORM}/netbird-relay /go/bin/netbird-relay
|
||||
COPY licenses/AGPL-3.0.txt licenses/BSD-3-Clause.txt licenses/Go-LICENSE licenses/Go-PATENTS /licenses/
|
||||
COPY licenses/third_party/ /licenses/third_party/
|
||||
RUN chmod -R a+rX /licenses
|
||||
COPY licenses/ /licenses/
|
||||
# Only the data directory shares the root group for arbitrary non-root UIDs.
|
||||
# Runtime-created Let's Encrypt keys retain the application's restrictive modes.
|
||||
RUN mkdir -p /var/lib/netbird && \
|
||||
chown 1000:0 /var/lib/netbird && \
|
||||
chmod 0770 /var/lib/netbird && \
|
||||
chmod -R a+rX /licenses
|
||||
|
||||
USER 65532
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT [ "/go/bin/netbird-relay" ]
|
||||
USER 1000:0
|
||||
ENV HOME=/var/lib/netbird
|
||||
ENV NB_LOG_FILE=console
|
||||
# Unprivileged port: runtimes such as OpenShift and Podman keep the kernel
|
||||
# default that reserves ports below 1024 for root. 8443/udp carries QUIC and
|
||||
# 9000 is the health probe.
|
||||
ENV NB_LISTEN_ADDRESS=":8443"
|
||||
EXPOSE 8443 8443/udp
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT ["/go/bin/netbird-relay"]
|
||||
|
||||
Reference in New Issue
Block a user