Node image reference
The node image runs the Breign CLI as an execution node. It is configured only through environment variables, so the same image serves every node of a cluster. To set up a cluster, start with Run a cluster of execution nodes.
Get the imageβ
Build it from the Breign CLI sources, with Podman or Docker, at the root of the repository:
podman build -f container/Containerfile -t breign-node .
docker build -f container/Containerfile -t breign-node .
Then push it to the registry your cluster pulls from.
Build optionsβ
| Argument | Effect |
|---|---|
WITH_CLAUDE=1 | Adds Claude Code (and Node.js) |
WITH_OPENCODE=1 | Adds OpenCode |
docker build -f container/Containerfile --build-arg WITH_CLAUDE=1 -t breign-node:claude .
Without them, the node only has fx, the base runtime: the node downloads it on first start, keeps it on its volume and follows its new versions. fx uses the agent's model, set in Breign, through the Breign AI Gateway: there is no account to connect.
Environment variablesβ
Connectionβ
| Variable | Role |
|---|---|
BREIGN_ | Required. The Breign API, for example https://api.breign.eu |
BREIGN_ | Required, or BREIGN_. The API key of the account that owns the node |
BREIGN_ | A file that contains the API key (a Kubernetes or Docker secret). Read by every breign command in the container |
BREIGN_ | The organization (id, slug or name) in which BREIGN_ is looked up by name |
BREIGN_ | The group to join: its name in BREIGN_ (case-insensitive), or its id |
On every start, once connected, the node associates itself with the group's organization, then joins the group. Both steps do nothing if they were already done. If the group cannot be found or the account is not allowed to join it, the node stops with an error.
Without BREIGN_, the node only connects. You can then add it to a group from Breign App, or bind agents to it directly.
Nodeβ
| Variable | Role | Default |
|---|---|---|
BREIGN_ | The node's name in Breign | <container hostname> (CLI) |
BREIGN_ | Executions the node runs at the same time (1 to 32) | 1 |
BREIGN_ | The working folders, see below | workspace=/workspace |
BREIGN_ | The tools Claude Code uses without asking, separated by spaces | Read Edit Write Glob Grep Bash |
BREIGN_ | The model imposed on Claude Code | the CLI's choice |
BREIGN_ | The model imposed on OpenCode | the CLI's choice |
BREIGN_ | Pins fx to this version | latest, followed |
BREIGN_ | Log level: info or debug | info |
Working foldersβ
BREIGN_ lists the folders where agents may work, separated by commas, each written alias=path or alias=path=label:
BREIGN_NODE_WORKSPACES="workspace=/workspace=Workspace,docs=/srv/docs"
- Only the alias is sent to Breign. An agent bound to a group works in a folder chosen by its alias: every node of the group must declare it.
- An alias has lowercase letters, digits and dashes, 63 characters at most.
- Missing folders are created. Folders removed from the list are removed from the node on the next start.
- In a folder that is a git repository, each conversation gets its own worktree, so the node can run several of them at once. In any other folder, the node runs one execution at a time.
Runtimesβ
| Variable | Role |
|---|---|
ANTHROPIC_ | Signs Claude Code in (image built with WITH_CLAUDE=1) |
OpenCode reads its usual configuration and provider variables. The Breign API key is never passed to Claude Code, OpenCode or fx during turns.
Volumesβ
| Path | Content |
|---|---|
/var/lib/breign | To keep, one per node. The node's identity, settings, queue, environments kept for conversations, cloned Git repositories (repos/, envs/), fx, and the home folder of the CLIs |
/workspace | The default working folder |
Without a volume on /var/lib/breign, each start creates a new node in Breign, and the previous one stays listed, offline. A lock prevents two nodes from running on the same volume on one machine; on a network volume, this lock is not guaranteed.
Git repositoriesβ
An agent can work on Git repositories instead of a folder (see Work on Git repositories). The node then:
- keeps a shared partial mirror of each repository in
/var/lib/breign/repos(purged after 14 days without use), and one worktree per conversation in/var/lib/breign/envs/<environment>/<folder>; - clones in the background, at most 4 repositories at a time: the turn waits in the queue meanwhile;
- gets Git credentials from Breign when Git asks for them, through the
breignbinary used as a credential helper, only during the turn: nothing is written to disk. Only HTTPS repositories are supported; - removes the dependencies and build outputs ignored by Git (
node_modules,target,.nextβ¦) of environments idle for an hour, and of every idle environment above 80 % of the disk; - never deletes an environment with uncommitted changes or commits that aren't pushed, even when Breign asks it to release it;
- reports its disk to Breign, which stops giving it new environments above 90 % (
MATE__).DISK_ HARD_ LIMIT_ PERCENT
Dependencies weigh far more than code (around 2 GB for a typical JavaScript repository once installed). Plan 15 to 20 GB for /var/lib/breign on a node that clones repositories; 2 GB is enough otherwise.
User and signalsβ
- The node runs as user
breign(uid and gid10001). On Kubernetes, setfsGroup: 10001so the volumes are writable. SIGTERM(orSIGINT) interrupts the running turn, then disconnects the node. Allow at least a few seconds before the container is killed (60 s in the examples).
Health checksβ
| Command | Succeeds when | Use |
|---|---|---|
breign-node-healthcheck | the node runs and Breign sees it connected | readiness |
breign-node-healthcheck --live | the node runs | liveness |
Do not use the full check for liveness: a Breign outage would restart every node.
The image also declares a Docker HEALTHCHECK (full check). Podman only keeps it when building with --format docker.
Commands in the containerβ
docker exec (or kubectl exec) runs a command next to the running node, with the same configuration. A command passed to docker run replaces the node's start.
docker exec breign-node breign node status
docker exec breign-node breign node envs
docker exec breign-node breign node unpair
| Command | Effect |
|---|---|
breign node status | Identity, folders, CLIs, and what Breign knows about the node |
breign node envs | Environments kept for conversations |
breign node join <group> / breign node leave <group> | Joins or leaves a group (name in BREIGN_, or id) |
breign node unpair | Revokes the node: it receives no more turns and forgets its identity |