Skip to content

Commit e469f0a

Browse files
authored
Merge pull request #1899 from link-assistant/issue-1879-7d12b117a430
fix(docker): use box 2.3.1 passthrough allowlist
2 parents ea897f7 + 5b7bcbd commit e469f0a

18 files changed

Lines changed: 1684 additions & 51 deletions

.changeset/use-box-2-3-1.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@link-assistant/hive-mind': patch
3+
---
4+
5+
Update Hive Mind Docker images to `konard/box` and `konard/box-dind` 2.3.1 so Docker-in-Docker deployments can use the upstream host-image passthrough allowlist.

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
#
1414
# Box image version: pinned to a specific release for stable, reproducible builds.
1515
# To upgrade: update the version tag below and in coolify/Dockerfile.
16+
# Keep this in lockstep with the DinD base-image release.
1617
# Latest Box releases: https://github.com/link-foundation/box/releases
1718
#
1819
# Build: docker build -t konard/hive-mind .
1920

20-
FROM konard/box:2.2.0
21+
FROM konard/box:2.3.1
2122
ARG HIVE_MIND_VERSION=latest
2223

2324
# --- Environment variables ---

Dockerfile.dind

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
#
99
# Box image version: pinned to a specific release for stable, reproducible builds.
1010
# To upgrade: update the dind version tag below.
11+
# Box 2.3.1 includes the host-image passthrough allowlist used by the issue #1879 runbook.
1112
# Latest Box releases: https://github.com/link-foundation/box/releases
1213

13-
FROM konard/box-dind:2.2.0
14+
FROM konard/box-dind:2.3.1
1415
ARG HIVE_MIND_VERSION=latest
1516

1617
# --- Environment variables ---

coolify/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
#
1414
# Box image version: pinned to a specific release for stable, reproducible builds.
1515
# To upgrade: update the version tag below and in the root Dockerfile.
16+
# Keep this in lockstep with the DinD base-image release.
1617
# Latest Box releases: https://github.com/link-foundation/box/releases
1718
#
1819
# Build: docker build -f coolify/Dockerfile -t konard/hive-mind .
1920

20-
FROM konard/box:2.2.0
21+
FROM konard/box:2.3.1
2122
ARG HIVE_MIND_VERSION=latest
2223

2324
# --- Environment variables ---

docs/UBUNTU-SERVER.hi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
```bash
3030
# विकल्प 1: Docker का उपयोग करें (अनुशंसित)
31-
docker pull konard/box:2.2.0
32-
docker run -it konard/box:2.2.0
31+
docker pull konard/box:2.3.1
32+
docker run -it konard/box:2.3.1
3333

3434
# विकल्प 2: Legacy Hive Mind bare-metal install script का उपयोग करें (इसे रखने वाले अंतिम commit पर pinned: 4f027b32)
3535
curl -fsSL -o- https://raw.githubusercontent.com/link-assistant/hive-mind/4f027b32/scripts/ubuntu-24-server-install.sh | bash

docs/UBUNTU-SERVER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The following instructions describe the legacy bare-metal installation on Ubuntu
3232

3333
```bash
3434
# Option 1: Use Docker (recommended)
35-
docker pull konard/box:2.2.0
36-
docker run -it konard/box:2.2.0
35+
docker pull konard/box:2.3.1
36+
docker run -it konard/box:2.3.1
3737

3838
# Option 2: Use the legacy Hive Mind bare-metal install script (pinned to the last commit that carried it: 4f027b32)
3939
curl -fsSL -o- https://raw.githubusercontent.com/link-assistant/hive-mind/4f027b32/scripts/ubuntu-24-server-install.sh | bash

docs/UBUNTU-SERVER.ru.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
```bash
3030
# Option 1: Use Docker (recommended)
31-
docker pull konard/box:2.2.0
32-
docker run -it konard/box:2.2.0
31+
docker pull konard/box:2.3.1
32+
docker run -it konard/box:2.3.1
3333

3434
# Option 2: Use the legacy Hive Mind bare-metal install script (pinned to the last commit that carried it: 4f027b32)
3535
curl -fsSL -o- https://raw.githubusercontent.com/link-assistant/hive-mind/4f027b32/scripts/ubuntu-24-server-install.sh | bash

docs/UBUNTU-SERVER.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
```bash
3030
# 选项 1:使用 Docker(推荐)
31-
docker pull konard/box:2.2.0
32-
docker run -it konard/box:2.2.0
31+
docker pull konard/box:2.3.1
32+
docker run -it konard/box:2.3.1
3333

3434
# 选项 2:使用旧版 Hive Mind 裸机安装脚本(固定到最后一个包含它的提交:4f027b32)
3535
curl -fsSL -o- https://raw.githubusercontent.com/link-assistant/hive-mind/4f027b32/scripts/ubuntu-24-server-install.sh | bash

docs/case-studies/issue-1879/README.md

Lines changed: 56 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Issue: https://github.com/link-assistant/hive-mind/issues/1879
66

77
Pull request: https://github.com/link-assistant/hive-mind/pull/1880
88

9+
Follow-up pull request: https://github.com/link-assistant/hive-mind/pull/1899
10+
911
Related issue: https://github.com/link-assistant/hive-mind/issues/1860 (the predecessor that
1012
made Hive Mind own Docker isolation command construction).
1113

@@ -40,6 +42,11 @@ store starts empty.
4042
- `raw/start-isolation-backend-excerpt.js``link-foundation/start`'s Docker isolation
4143
backend (`js/src/lib/isolation.js`), showing it only pulls when `dockerImageExists()` is
4244
false (it does **not** force-pull).
45+
- `raw/box-release-v2.3.1.json` — latest `link-foundation/box` release metadata verified on
46+
2026-06-11. It publishes `konard/box:2.3.1` and `konard/box-dind:2.3.1`.
47+
- `raw/box-issue-94.json` / `raw/box-pr-95.json` — upstream host-image passthrough work.
48+
- `raw/box-issue-96.json` / `raw/box-pr-98.json` — upstream public-mode positive coverage.
49+
- `raw/box-issue-97.json` / `raw/box-pr-99.json` — upstream per-image passthrough allowlist.
4350

4451
## Timeline / Sequence of Events
4552

@@ -123,10 +130,12 @@ empty-store pull, but it is a precondition for reliable reuse and reproducibilit
123130

124131
## Existing Components / Libraries Considered
125132

126-
- **box native host-image passthrough** (box v2.2.0, `DIND_HOST_PASSTHROUGH`) — copies host
127-
images into the nested daemon at entrypoint startup; `public` mode is secret-safe. This is the
128-
durable, zero-manual-step fix and is now the **primary** recommendation (see runbook). It
129-
became available _after_ the initial preload-helper solution was written, by way of box#94.
133+
- **box native host-image passthrough** (box v2.3.1, `DIND_HOST_PASSTHROUGH` +
134+
`DIND_HOST_PASSTHROUGH_IMAGES`) — copies selected host images into the nested daemon at
135+
entrypoint startup; `public` mode is secret-safe and the image allowlist scopes the copy to
136+
Hive Mind's own repositories. This is the durable, zero-manual-step fix and is now the
137+
**primary** recommendation (see runbook). The core passthrough shipped in box#94; the
138+
positive public-mode test and per-image allowlist shipped in box#96 and box#97.
130139
- **`docker save | docker load`** (built-in) — the simplest, dependency-free way to copy an
131140
image from the host daemon into the nested daemon. Chosen for the preload helper, retained as
132141
the exact per-image fallback when mounting the host socket is undesirable.
@@ -139,11 +148,11 @@ empty-store pull, but it is a precondition for reliable reuse and reproducibilit
139148
- **`docker run --pull`** (built-in) — the lever to force reuse (`never`) or refresh
140149
(`always`). Wired up so operators can opt in.
141150

142-
## Solution Applied (this PR)
151+
## Solution Applied (PR #1880 + follow-up PR #1899)
143152

144-
The fix gives operators the levers to reuse the host image and makes the behavior observable.
145-
All changes are in code Hive Mind controls; the cross-daemon seeding itself is a deploy-time
146-
action (a helper script is provided) plus an upstream request.
153+
PR #1880 gives operators the levers to reuse the host image and makes the behavior observable.
154+
Follow-up PR #1899 consumes the upstream box release that performs scoped host-image passthrough
155+
at container startup.
147156

148157
### 1. Image tag pinning — `src/isolation-runner.lib.mjs`
149158

@@ -183,40 +192,38 @@ docker load`, skipping the copy if the nested daemon already has the image. Run
183192
(flag presence/ordering, pinned-tag + `never` combination). The issue #1860 suite still
184193
passes unchanged.
185194

186-
### 7. Box base-image bump to v2.2.0 (enables native passthrough)
195+
### 7. Box base-image bump to v2.3.1 (latest passthrough release)
187196

188-
- `Dockerfile.dind``FROM konard/box-dind:2.2.0`, `Dockerfile` and `coolify/Dockerfile`
189-
`FROM konard/box:2.2.0`, and the `docs/UBUNTU-SERVER*.md` pull/run examples → `konard/box:2.2.0`.
190-
v2.2.0 is the first release carrying box's native host-image passthrough (box#94 / box PR#95),
191-
so the DinD deployment can now seed the nested daemon automatically (see runbook). `release.yml`
197+
- `Dockerfile.dind``FROM konard/box-dind:2.3.1`, `Dockerfile` and `coolify/Dockerfile`
198+
`FROM konard/box:2.3.1`, and the `docs/UBUNTU-SERVER*.md` pull/run examples → `konard/box:2.3.1`.
199+
v2.3.1 includes the original native host-image passthrough (box#94), the public-mode positive
200+
integration coverage (box#96), and the per-repository image allowlist (box#97), so the DinD
201+
deployment can seed only the Hive Mind images automatically (see runbook). `release.yml`
192202
extracts these `FROM` tags automatically, so the bump flows through to published images.
193203

194204
## Recommended Operator Runbook (full reuse, no re-download)
195205

196-
### Primary: native box host-image passthrough (box v2.2.0+)
206+
### Primary: native box host-image passthrough (box v2.3.1+)
197207

198-
Now that `Dockerfile.dind` is based on `konard/box-dind:2.2.0`, the nested daemon can be seeded
208+
Now that `Dockerfile.dind` is based on `konard/box-dind:2.3.1`, the nested daemon can be seeded
199209
automatically from the host at container startup — no manual step. Run the `hive-mind` container
200-
with the host Docker socket mounted read-only and passthrough enabled in `public` mode:
210+
with the host Docker socket mounted read-only, passthrough enabled in `public` mode, and the
211+
image allowlist scoped to Hive Mind's own images:
201212

202213
```bash
203214
docker run -d --name hive-mind --privileged \
204215
-v /var/run/docker.sock:/var/run/host-docker.sock:ro \
205216
-e DIND_HOST_PASSTHROUGH=public \
217+
-e DIND_HOST_PASSTHROUGH_IMAGES="konard/hive-mind konard/hive-mind-dind" \
206218
konard/hive-mind-dind:<tag>
207219
```
208220

209221
`public` mode copies only images that carry a RepoDigest from an allowlisted public registry, so
210-
the host's already-downloaded `konard/hive-mind` and `konard/hive-mind-dind` (pulled from Docker
211-
Hub during provisioning) land in the nested daemon, while private images and registry credentials
212-
stay on the host. The subsequent `docker run … konard/hive-mind-dind:<tag>` inside the container
213-
then finds the image locally and does **not** re-download it.
214-
215-
> **Scope note:** `public` mode passes through _all_ public host images, not just hive-mind's.
216-
> That is harmless (and secret-safe) but broader than strictly necessary. A per-repository
217-
> allowlist that would restrict passthrough to only `konard/hive-mind*` is requested upstream as
218-
> box#97; until it ships, `public` is the recommended default. For an exact, image-by-image seed
219-
> use the fallback below.
222+
private images and registry credentials stay on the host. `DIND_HOST_PASSTHROUGH_IMAGES` narrows
223+
that public set to the host's already-downloaded `konard/hive-mind` and
224+
`konard/hive-mind-dind` images. The subsequent
225+
`docker run … konard/hive-mind-dind:<tag>` inside the container then finds the image locally and
226+
does **not** re-download it.
220227

221228
Then, to make isolated tasks reuse the seeded image and fail fast instead of silently
222229
re-downloading, pin the tag and forbid pulls:
@@ -239,8 +246,8 @@ the preload helper, which does `docker save <image> | docker exec -i <container>
239246
`export HIVE_MIND_DOCKER_ISOLATION_PULL=never`.
240247

241248
The durable fix — baking the seeding into the DinD image/entrypoint so the manual preload step is
242-
unnecessary — is now available upstream as box's native passthrough (box#94, shipped in v2.2.0;
243-
see below).
249+
unnecessary — is now available upstream as box's native passthrough plus per-image allowlisting
250+
(box#94 and box#97, included in v2.3.1; see below).
244251

245252
## Upstream Report
246253

@@ -267,9 +274,9 @@ now copies host images into the nested daemon at startup, controlled by:
267274
- `DIND_HOST_PASSTHROUGH_REGISTRIES` — registry-host allowlist.
268275
- `DIND_PRELOAD_TARBALL` / `DIND_PRELOAD_IMAGES` — explicit tarball / image preloads.
269276

270-
This is the durable fix the runbook below now recommends as the primary approach.
277+
This is the durable fix the runbook above now recommends as the primary approach.
271278

272-
### box#96 — public-mode passthrough test is a false positive (open)
279+
### box#96 — public-mode passthrough test is a false positive (RESOLVED, shipped in box v2.3.1)
273280

274281
While verifying the v2.2.0 release run for false positives (per the PR review request) we found
275282
a coverage gap in box's own test suite. Issue filed:
@@ -285,13 +292,24 @@ even though that is exactly the behavior Hive Mind depends on. The report includ
285292
fix (seed the host daemon with a small public image carrying a RepoDigest and assert it lands in
286293
the inner daemon).
287294

288-
### box#97 — per-repository passthrough allowlist (open feature request)
295+
**Status: implemented.** box PR **https://github.com/link-foundation/box/pull/98** now seeds the
296+
integration host daemon with a real public image (`alpine:3.20`) and asserts that public mode
297+
copies it into the inner daemon and logs the load. This makes a "public copies nothing" regression
298+
fail box CI instead of shipping green.
289299

290-
box's passthrough can be narrowed by **registry** (`DIND_HOST_PASSTHROUGH_REGISTRIES`) but not by
291-
**repository / image name**. Hive Mind wants to seed the nested daemon with _only_ its own
292-
official Docker Hub images (`konard/hive-mind`, `konard/hive-mind-dind`) and nothing else. The
293-
closest current fit, `DIND_HOST_PASSTHROUGH=public`, copies **every** host image with a public
294-
RepoDigest. Issue filed: **https://github.com/link-foundation/box/issues/97** — requesting a
300+
### box#97 — per-repository passthrough allowlist (RESOLVED, shipped in box v2.3.1)
301+
302+
Before box v2.3.1, passthrough could be narrowed by **registry**
303+
(`DIND_HOST_PASSTHROUGH_REGISTRIES`) but not by **repository / image name**. Hive Mind wants to
304+
seed the nested daemon with _only_ its own official Docker Hub images (`konard/hive-mind`,
305+
`konard/hive-mind-dind`) and nothing else. The closest current fit,
306+
`DIND_HOST_PASSTHROUGH=public`, copies **every** host image with a public RepoDigest. Issue
307+
filed: **https://github.com/link-foundation/box/issues/97** — requesting a
295308
`DIND_HOST_PASSTHROUGH_IMAGES` space-separated image-name/glob allowlist that composes with the
296-
existing mode filter. Until that ships, `public` mode is the working, secret-safe default and the
297-
preload helper (below) is the precise per-image alternative.
309+
existing mode filter.
310+
311+
**Status: implemented.** box PR **https://github.com/link-foundation/box/pull/99** added
312+
`DIND_HOST_PASSTHROUGH_IMAGES`. Empty keeps the previous behavior; when set, host images must
313+
match both the mode filter and at least one allowlist pattern. For Hive Mind the recommended value
314+
is `konard/hive-mind konard/hive-mind-dind`, which gives the exact image scope the original issue
315+
asked for.

0 commit comments

Comments
 (0)