Reeve Docs

Docs / Development

Image builds

Reeve ships three container images: the backend, the frontend and the Matter bridge sidecar. Each has one Dockerfile that builds everything from source in stages, so a checkout and Docker are all a build needs.

Image Dockerfile Build context
ghcr.io/reeve-iot/reeve-backend backend/Dockerfile the repository root
ghcr.io/reeve-iot/reeve-frontend frontend/Dockerfile frontend/, plus the repository root as the named context repo
ghcr.io/reeve-iot/reeve-matter-bridge services/matter-bridge/Dockerfile the repository root

All builds need BuildKit, which every current Docker with the buildx plugin has.

Building locally

From the repository root:

docker build -f backend/Dockerfile -t reeve-backend:local .
docker build -f frontend/Dockerfile --build-context repo=. -t reeve-frontend:local frontend
docker build -f services/matter-bridge/Dockerfile -t reeve-matter-bridge:local .

The frontend image takes the licence file and the operating-system package notices from the repository root, which is why it needs the repo named context. deploy/docker-compose.yml builds the same images when you start the stack from source.

Releases

A version tag (vX.Y.Z or vX.Y.Z-rc.N) starts the release workflow (.github/workflows/release.yml). It builds the three images and pushes them to ghcr.io/reeve-iot/ with the tags 1.0.0, 1.0, 1 and latest, packages the Helm chart and pushes it to oci://ghcr.io/reeve-iot/charts/reeve, publishes the NuGet packages and the npm client, and attaches the Android APK to the GitHub Release. The tag sets the version of the images, packages, chart and APK. The chart's version and appVersion are set to the tag, and the chart's default image tags follow it.

A release is built from the tagged commit, not promoted from an earlier build, because the version is compiled into the binary.

Backend image

backend/Dockerfile has these stages:

Stage Contains
build The .NET SDK image. Restores, then publishes Reeve.Api
final The aspnet runtime image, libgssapi-krb5-2, the published output and the empty plugin directory
production final as it is. This is the default target
e2e final plus Reeve.Api.E2E.dll. Only the end-to-end suite builds it, see end-to-end testing

Build arguments:

Argument Default Effect
VERSION the version in backend/Directory.Build.props Stamped into the assembly. A + suffix becomes the informational version only
FILE_VERSION derived from the version The assembly file version
REEVE_ROLL_FROM empty Passed as -p:ReeveRollFrom to the publish. Only the host roll harness sets it; a release build takes the value from backend/Directory.Build.props
DOTNET_ASPNET_IMAGE, DOTNET_SDK_IMAGE pinned in the Dockerfile The runtime and SDK base images

The runtime image

Npgsql loads libgssapi_krb5.so.2 by name, and the aspnet image does not ship it. Without it the process logs Cannot load library libgssapi_krb5.so.2 and fails to connect when the first connection opens, not at build time. backend/docker/runtime-deps.sh installs the library and creates /var/lib/reeve/plugins, owned by the application user, and the build fails if the library is missing from the finished image.

One .NET release per image

DOTNET_ASPNET_IMAGE and DOTNET_SDK_IMAGE pin one .NET release each, as an exact version and a multi-architecture digest, for example aspnet:11.0.0@sha256:… beside sdk:11.0.100@sha256:…. Renovate moves the two in one pull request. A floating tag such as aspnet:11.0 is not used, because it resolves to whatever the registry holds when the build runs, so the runtime and the compiler could come from different releases.

The app's runtimeconfig.json asks for Microsoft.NETCore.App and Microsoft.AspNetCore.App at the SDK's X.Y.0. A runtime image of another release fails at start with Framework 'Microsoft.NETCore.App', version 'X.Y.0' not found, so the build refuses to finish unless the runtime image carries every runtime the SDK image ships.

ReadyToRun

dotnet publish runs framework-dependent and ReadyToRun (-r <rid> --no-self-contained -p:PublishReadyToRun=true). That trades a larger image layer for less JIT work and less native runtime memory at start. The runtime identifier comes from TARGETARCH (or uname -m), so docker buildx build --platform linux/arm64 produces arm64 code.

Frontend image

frontend/Dockerfile builds the single-page app with Node and serves the result with nginx. VITE_API_BASE_URL (build argument, empty by default) sets the API base the app is built against; the default calls the same origin. At start, nginx proxies /api and /hubs to REEVE_BACKEND_UPSTREAM (default backend:8080) and answers /healthz for the container health check.

Matter bridge image

The Matter bridge (services/matter-bridge/) compiles node-datachannel from source. The published prebuilt binaries statically link an end-of-life OpenSSL 1.1.1w in the DTLS and SRTP path, so building from source against OpenSSL 3 is required. The compile pulls libdatachannel from GitHub, and GitHub throttles anonymous git per source IP, which git reports as could not read Username for 'https://github.com'. The condition is intermittent and can last tens of minutes.

scripts/build-native.sh therefore retries the clone, backing off 30 s longer each time. REEVE_CLONE_ATTEMPTS sets the number of attempts (default 8). A GITHUB_TOKEN build secret authenticates the clone and lifts the anonymous limit; any token with read access to public repositories will do. The token is mounted only by the RUN step that clones, passes through a git configuration file deleted in the same step, and the cloned tree's .git directories are removed, so no layer carries it. Pass it with:

docker build -f services/matter-bridge/Dockerfile --secret id=github_token,env=GITHUB_TOKEN -t reeve-matter-bridge:local .

The runtime stage starts from node:26-bookworm-slim and takes only node_modules and the compiled TypeScript. It refuses to build when node_datachannel.node is missing, when a prebuilt platform package is present, when any OpenSSL 1.x string is in the shipped modules, or when the binary does not declare OpenSSL 3.

Other images

deploy/test-broker/Dockerfile is the MQTT broker fixture the test stacks use. It copies files over a published base and installs nothing. sdk/python/tools/Dockerfile.extism-py is the Python plugin toolchain; see plugin authoring.