Image toolchain for agents in Rex terminals #5

Closed
opened 2026-10-31 13:09:03 +00:00 by mikluko · 6 comments
Owner

Map: #1

Question

What joins the machine-rex image (baox, bao, git, gh, kubectl, aws, forgejo-mcp wiring), from which sources, and is packaging shared with the progressor agent image? The answer is the Dockerfile change list.

Map: #1 ## Question What joins the `machine-rex` image (`baox`, `bao`, `git`, `gh`, `kubectl`, `aws`, `forgejo-mcp` wiring), from which sources, and is packaging shared with the progressor agent image? The answer is the Dockerfile change list.
Author
Owner

Context for this ticket, from mikluko/baox:

  • .deb packages for amd64 and arm64 in the sarak.sh Debian registry (distribution trixie, component main), so it installs from apt like rex and claude-code. A sarak.sh/mikluko/baox image also exists.
  • Login order: BAO_TOKEN, then openbao.token_file, then openbao.kubernetes (the pod's projected ServiceAccount token, mount/role configurable). In this pod that means the kubernetes block with role rex-side naming from the OpenBao ticket.
  • Config at $BAOX_CONFIG or ~/.config/baox/config.yaml; unknown keys are errors. Open: bake it into the image (BAOX_CONFIG=/etc/baox/config.yaml) or keep it in the home on /srv/rex.
  • It covers git credential helpers (GitHub, Forgejo), gh/fj via run, the kubectl ExecCredential, AWS credential_process, and the headersHelper for forgejo-mcp. baox token feeds the bao CLI.
Context for this ticket, from [mikluko/baox](https://sarak.sh/mikluko/baox): - `.deb` packages for amd64 and arm64 in the `sarak.sh` Debian registry (distribution `trixie`, component `main`), so it installs from apt like `rex` and `claude-code`. A `sarak.sh/mikluko/baox` image also exists. - Login order: `BAO_TOKEN`, then `openbao.token_file`, then `openbao.kubernetes` (the pod's projected ServiceAccount token, `mount`/`role` configurable). In this pod that means the `kubernetes` block with role `rex`-side naming from the OpenBao ticket. - Config at `$BAOX_CONFIG` or `~/.config/baox/config.yaml`; unknown keys are errors. Open: bake it into the image (`BAOX_CONFIG=/etc/baox/config.yaml`) or keep it in the home on `/srv/rex`. - It covers git credential helpers (GitHub, Forgejo), `gh`/`fj` via `run`, the kubectl ExecCredential, AWS `credential_process`, and the `headersHelper` for `forgejo-mcp`. `baox token` feeds the `bao` CLI.
mikluko self-assigned this 2026-10-31 15:34:11 +00:00
Author
Owner

Q1 (base) decided: the image no longer builds on machine-debian (arm64-only; its systemd and unbound parts never run under dumb-init). It goes FROM debian:trixie-YYYYMMDD, multi-arch, with the needed packages inlined. The repo is renamed mikluko/kuberex, the image becomes sarak.sh/mikluko/kuberex. Still open here: tool sources, baox config location, credential-helper wiring, Claude Code defaults, sharing with progressor.

Q1 (base) decided: the image no longer builds on `machine-debian` (arm64-only; its systemd and unbound parts never run under `dumb-init`). It goes `FROM debian:trixie-YYYYMMDD`, multi-arch, with the needed packages inlined. The repo is renamed `mikluko/kuberex`, the image becomes `sarak.sh/mikluko/kuberex`. Still open here: tool sources, baox config location, credential-helper wiring, Claude Code defaults, sharing with progressor.
Author
Owner

Decided so far in this ticket:

  • Rex and Claude Code are installed at pod startup, not baked: an init container runs a real apt-get install through overlayfs whose upper dirs sit on a shared emptyDir; the main container mounts the same overlays and drops to rex. Proven or refuted in #10.
  • Consequence for Pod shape (#4): hostUsers: false and namespaced CAP_SYS_ADMIN replace "all capabilities dropped".
  • The rex apt credential is a secret parameter at runtime, no longer a build secret.
Decided so far in this ticket: - Rex and Claude Code are installed at pod startup, not baked: an init container runs a real `apt-get install` through overlayfs whose upper dirs sit on a shared emptyDir; the main container mounts the same overlays and drops to `rex`. Proven or refuted in #10. - Consequence for Pod shape (#4): `hostUsers: false` and namespaced `CAP_SYS_ADMIN` replace "all capabilities dropped". - The rex apt credential is a secret parameter at runtime, no longer a build secret.
Author
Owner

Answer

Base. FROM debian:trixie-YYYYMMDD, independent of machine-debian, multi-arch (amd64 + arm64). Image sarak.sh/mikluko/kuberex.

Baked toolchain.

tool source
git, golang, nodejs, npm, build-essential, openssh-client, ca-certificates, libpam0g Debian
baox sarak.sh apt registry (trixie, main)
gh GitHub's apt repo
kubectl pkgs.k8s.io apt repo
aws Debian awscli if v2, else AWS's installer, pinned
bao, fj release binaries pinned by version and checksum

Installed at startup. Rex and Claude Code, through a real apt-get install in the init container over overlayfs with upper dirs on a shared emptyDir; the main container mounts the same overlays and drops to rex. Mechanism proven or refuted in #10.

  • Versions: REX_VERSION, CLAUDE_CODE_VERSION, each defaulting to the newest.
  • Credential: netrc file at REX_APT_AUTH (default /etc/rex-apt/auth.conf); on saraksh, Secret rex-apt from an ExternalSecret on OpenBao kv/k8s/agents/rex-apt. No build secret.
  • Pod shape amended: hostUsers: false, namespaced CAP_SYS_ADMIN.

Wiring, baked system-wide.

  • baox config at /etc/baox/config.yaml, BAOX_CONFIG set.
  • /etc/gitconfig credential helpers (GitHub, Forgejo); KUBECONFIG=/etc/kube/config with the baox kube exec user; AWS_CONFIG_FILE with credential_process.
  • /usr/local/bin/claude wrapper: baox run --env-file /etc/baox/claude.env -- /usr/bin/claude "$@", CLAUDE_CODE_OAUTH_TOKEN from agents/anthropic/agent-rex.
  • /etc/claude-code/managed-settings.json: permissions.defaultMode: bypassPermissions; forgejo-mcp with headersHelper: baox forgejo header sarak.

Not shared with the progressor agent image.

## Answer **Base.** `FROM debian:trixie-YYYYMMDD`, independent of `machine-debian`, multi-arch (amd64 + arm64). Image `sarak.sh/mikluko/kuberex`. **Baked toolchain.** | tool | source | |---|---| | `git`, `golang`, `nodejs`, `npm`, `build-essential`, `openssh-client`, `ca-certificates`, `libpam0g` | Debian | | `baox` | `sarak.sh` apt registry (`trixie`, `main`) | | `gh` | GitHub's apt repo | | `kubectl` | `pkgs.k8s.io` apt repo | | `aws` | Debian `awscli` if v2, else AWS's installer, pinned | | `bao`, `fj` | release binaries pinned by version and checksum | **Installed at startup.** Rex and Claude Code, through a real `apt-get install` in the init container over overlayfs with upper dirs on a shared emptyDir; the main container mounts the same overlays and drops to `rex`. Mechanism proven or refuted in #10. - Versions: `REX_VERSION`, `CLAUDE_CODE_VERSION`, each defaulting to the newest. - Credential: netrc file at `REX_APT_AUTH` (default `/etc/rex-apt/auth.conf`); on `saraksh`, Secret `rex-apt` from an ExternalSecret on OpenBao `kv/k8s/agents/rex-apt`. No build secret. - Pod shape amended: `hostUsers: false`, namespaced `CAP_SYS_ADMIN`. **Wiring, baked system-wide.** - `baox` config at `/etc/baox/config.yaml`, `BAOX_CONFIG` set. - `/etc/gitconfig` credential helpers (GitHub, Forgejo); `KUBECONFIG=/etc/kube/config` with the `baox kube` exec user; `AWS_CONFIG_FILE` with `credential_process`. - `/usr/local/bin/claude` wrapper: `baox run --env-file /etc/baox/claude.env -- /usr/bin/claude "$@"`, `CLAUDE_CODE_OAUTH_TOKEN` from `agents/anthropic/agent-rex`. - `/etc/claude-code/managed-settings.json`: `permissions.defaultMode: bypassPermissions`; `forgejo-mcp` with `headersHelper: baox forgejo header sarak`. **Not shared** with the progressor agent image.
Author
Owner

Correction to the answer: bao comes from OpenBao's apt repository, not a pinned binary. fj is not in the image.

Correction to the answer: `bao` comes from OpenBao's apt repository, not a pinned binary. `fj` is not in the image.
Author
Owner

Correction: no claude wrapper and no CLAUDE_CODE_OAUTH_TOKEN from OpenBao. Claude Code is logged in interactively in a Rex terminal; credentials persist in the home on /srv/rex.

Correction: no `claude` wrapper and no `CLAUDE_CODE_OAUTH_TOKEN` from OpenBao. Claude Code is logged in interactively in a Rex terminal; credentials persist in the home on `/srv/rex`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
mikluko/kuberex#5
No description provided.