diff --git a/.github/workflows/redhat-certify.yml b/.github/workflows/redhat-certify.yml index 7c26c79fb..c6cd62bca 100644 --- a/.github/workflows/redhat-certify.yml +++ b/.github/workflows/redhat-certify.yml @@ -33,6 +33,7 @@ on: - client-rootless - reverse-proxy - netbird-server + - signal version: description: "Released version, e.g. v0.80.0" type: string @@ -68,6 +69,7 @@ jobs: "client-rootless ghcr.io/netbirdio/netbird -rootless-ubi" "reverse-proxy ghcr.io/netbirdio/reverse-proxy -ubi" "netbird-server ghcr.io/netbirdio/netbird-server -ubi" + "signal ghcr.io/netbirdio/signal -ubi" ) matrix="[]" missing=() diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ebb4a8525..1e7acbaa7 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -528,6 +528,41 @@ dockers_v2: "org.opencontainers.image.revision": "{{.FullCommit}}" "org.opencontainers.image.source": "{{.GitURL}}" "maintainer": "dev@netbird.io" + - id: signal-ubi + disable: "{{ .Env.SKIP_DOCKER_PUSH }}" + ids: + - netbird-signal + images: + - netbirdio/signal + - ghcr.io/netbirdio/signal + tags: + - "{{ .Version }}-ubi" + - "{{ if eq .Env.SKIP_PUBLISH \"false\" }}ubi-latest{{ end }}" + dockerfile: signal/Dockerfile.ubi + platforms: + - linux/amd64 + - linux/arm64 + build_args: + VERSION: "{{ .Version }}" + RELEASE: "{{ .Timestamp }}" + hooks: + pre: + - cmd: 'sh release_files/collect-licenses.sh -l signal/LICENSE "{{ .ContextDir }}/licenses" ./signal amd64 arm64' + env: + - GOOS=linux + - CGO_ENABLED=0 + labels: + "org.opencontainers.image.created": "{{.Date}}" + "org.opencontainers.image.version": "{{.Version}}" + "org.opencontainers.image.revision": "{{.FullCommit}}" + "org.opencontainers.image.source": "{{.GitURL}}" + annotations: + "org.opencontainers.image.created": "{{.Date}}" + "org.opencontainers.image.title": "{{.ProjectName}}" + "org.opencontainers.image.version": "{{.Version}}" + "org.opencontainers.image.revision": "{{.FullCommit}}" + "org.opencontainers.image.source": "{{.GitURL}}" + "maintainer": "dev@netbird.io" - id: management disable: "{{ .Env.SKIP_DOCKER_PUSH }}" ids: diff --git a/signal/Dockerfile.ubi b/signal/Dockerfile.ubi new file mode 100644 index 000000000..f0a6552da --- /dev/null +++ b/signal/Dockerfile.ubi @@ -0,0 +1,38 @@ +FROM registry.access.redhat.com/ubi9/ubi-minimal@sha256:7fbeae18dc9476399f565e68255f602a3374ea8614ba3d14843565131a13ff93 + +ARG TARGETPLATFORM +ARG VERSION=dev +ARG RELEASE=1 + +LABEL name="netbird-signal" \ + maintainer="NetBird " \ + vendor="NetBird GmbH" \ + version="${VERSION}" \ + release="${RELEASE}" \ + summary="NetBird Signal" \ + description="NetBird Signal brokers the connection handshakes between peers in NetBird networks." + +COPY --chmod=0555 ${TARGETPLATFORM}/netbird-signal /go/bin/netbird-signal +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 1000:0 +ENV HOME=/var/lib/netbird +ENV NB_LETSENCRYPT_DATA_DIR="/var/lib/netbird" +# Unprivileged ports: runtimes such as OpenShift and Podman keep the kernel +# default that reserves ports below 1024 for root, so serve on the legacy +# gRPC port instead of 80/443. With Let's Encrypt, the empty listen address +# answers challenges on that port when public 443 is forwarded to it. +# 9090 is the metrics endpoint. +ENV NB_PORT="10000" +ENV NB_LETSENCRYPT_LISTEN_ADDRESS="" +EXPOSE 10000 9090 +# The signal server only handles SIGINT for a graceful stop. +STOPSIGNAL SIGINT +ENTRYPOINT ["/go/bin/netbird-signal", "run"] +CMD ["--log-file", "console"]