7 Commits
Author SHA1 Message Date
yetone 76b490576f docker: the image runs on Debian 13, so an npm package's glibc 2.38 binary starts
Passings_z on X: an MCP server in the Library never started in the
Docker image, and the hub tried it again every minute. The server is
arcane-rmcp (dinglebear-ai/rarcane): its npm launcher runs a Rust
binary linked against glibc 2.38, and the image was debian:12-slim with
glibc 2.36, so it died at once with "GLIBC_2.38 not found" and npx
exited 1. The runtime base is now debian:13-slim (glibc 2.41) and Node
is taken from node:24.22.3-trixie-slim to match. ca-certificates, curl,
groupadd/useradd and bash are all in trixie under the same names. The
Docker docs (en, zh, ja) and docs/reference.md say Debian 13; the
search indexes and llms-full.txt are rebuilt (node docs-index.mjs).

The hub already shows the reason: the Library's check reports "exited
(1)" with the server's last stderr line, which here is the GLIBC line,
so nothing there changes.

Run (linux/amd64, podman 4.9.3 in the magpie-desktop WSL distro):
- built the image from this tree; ldd --version says 2.41, Debian 13.7
- `npx -y arcane-rmcp --version` (from npmmirror: npmjs unpublished it
  on 08-03): ghcr.io/yetone/magpie:latest (glibc 2.36) exits 1 with
  "version `GLIBC_2.38' not found"; the new image prints
  "rarcane 0.4.4", exit 0
- docker.yml's smoke steps by hand: serve answers on 3425 (401 for a
  keyless request from the host, as podman's network makes it remote),
  magpie healthcheck ok, node v24.22.3, npm/npx 11.19.1, uv/uvx 0.13.7,
  python3/python/curl on PATH as nonroot (65532), chat/completions 401
  with an error JSON, `provider add` into the volume works
- mote: node --test search/worker/docker-tags (50 pass), go test
  ./internal/testenv (docs-index sums) ok

Not tried: linux/arm64 (no emulation on the Linux box, no docker on
mote or mica); docker.yml builds and smoke-tests it on a native arm
runner. A volume made by the Debian 12 image was not reused across the
upgrade by hand; uid 65532 and the /config layout are unchanged.
2026-11-20 09:55:43 +08:00
yetone 69233d6bcf docker: the image has npx, node, npm, uvx and python for the Library's MCP servers
Passings_z on X: in magpie's Docker image, adding Chrome DevTools' MCP
server from the Library said "npx not found". The runtime stage is
debian:12-slim with ca-certificates and curl only, and the Library's
servers run in the container (gateway mode keeps Library's MCP servers
and the router), so every featured entry but the remote ones failed the
same way: npx for chrome-devtools, playwright, filesystem, memory,
sequential-thinking, brave, firecrawl, tavily and everme, uvx for fetch,
git and time, and the registry's npx/uvx entries.

The image now copies in Node 24.22.3 (node, npm, npx, from the official
bookworm image, matching Debian 12's glibc) and uv 0.13.7 (uv, uvx, from
astral's image). python and python3 are a two-line shim onto uv's own
Python, which uv downloads into the volume on first use (UV_PYTHON=3.14).
UV_PYTHON_PREFERENCE=only-managed keeps uv from taking the shim as an
interpreter: without it uvx recursed and hung looking for one.

Size (docker image inspect / du -sxm / as root):
  origin/main  74,636,782 B compressed, 190 MB on disk
  this         142,667,379 B compressed, 370 MB on disk  (+68 MB, +180 MB)
node is 127 MB of it, npm 19 MB, uv and uvx 43 MB. Bun in place of npx
was weighed and left: agents in the container read PATH themselves, and
Bun's Node compatibility isn't every server's.

The image still has no browser (Chrome would be ~300 MB more for every
user). Chrome DevTools' and Playwright's servers start, list their tools,
and every tool then fails: "Could not find Google Chrome executable for
channel 'stable' at: /opt/google/chrome/chrome" (seen in the image). The
check now reports such a server, run by npx/bunx/pnpx in a container with
no /opt/google/chrome/chrome and no option pointing it at a browser
(--browserUrl/-u, --wsEndpoint, --executablePath, --channel,
--autoConnect; --cdp-endpoint, --executable-path, --browser,
--extension), as Why "nobrowser" with its tools still counted. The row
says "no Chrome here", and its tooltip points at Magpie Browser or the
server's option for a Chrome it can reach; the hub's text says the same.
Desktops, macOS and an image with Chrome are unchanged. A docker-launched
(OCI) entry still says docker not found: there is no Docker in the
container. Docs (en, zh, ja docker.html) get an "MCP servers" section;
the Docker workflow's smoke test runs node/npm/npx/uvx/uv -v and finds
python3 and python.

Run:
- Docker on xiaomi-gpu, origin/main's Dockerfile vs this one, web mode
  with a fresh volume, servers added with `magpie library mcp add` and
  checked through POST /api/library/mcp/check:
  - origin/main: chrome-devtools, memory: notfound "npx"; fetch:
    notfound "uvx" (the report).
  - this: memory ok, 9 tools; fetch (uvx mcp-server-fetch) ok, 1 tool,
    Python downloaded on first run; chrome-devtools error nobrowser
    --browserUrl, 33 tools.
  - tools/call over stdio inside the container with a small node MCP
    client: memory create_entities returned the entity; fetch fetched
    https://example.com; chrome-devtools new_page returned the Chrome
    error above.
- go test -run 'TestNoBrowser|TestCheckSaysNoBrowser|TestCheckStdio'
  ./internal/library on mote: ok. Broken by hand (the hook in
  checkServer turned off): TestCheckSaysNoBrowser red, "got {State:ok
  Tools:3 …}".
- GUI on mote, Chromium and WebKit, en zh zh-TW ja de, 1100 and 390:
  mcp-no-browser (new), mcp-home-health, library-mcp-health, i18n-keys,
  i18n-en-no-cjk: 58 of 58 pass.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... and go build ok on mote.
- go test -timeout 45m ./... on mote at this head (on e1c186cfe): 103
  packages ok, none failed (internal/gateway 1039s, internal/library
  408s).

Not tried: an arm64 build of the image (both base images are
multi-arch; CI builds it). The test box's network to npm dropped
mid-run: npx -y then timed out the 30s check step, and one npx install
cut short left ~/.npm/_npx with a missing module until it was removed;
that is npm's cache, the same on a desktop.
2026-11-18 10:02:53 +08:00
yetone 772f936272 perf: jsonschema's metaschemas are compiled on first use, not at launch
github.com/santhosh-tekuri/jsonschema/v6's init compiles every draft's
metaschema (4, 6, 7, 2019-09, 2020-12 and their vocabularies): ~1.7 MB
and ~21,000 allocations on every launch, the largest init left in the
binary. magpie compiles a schema only for a Claude TUI answer tool, so
`magpie statusline`, run on each Claude Code message, paid it for
nothing.

v6.0.3's non-test files are now in third_party/jsonschema (go.mod
replace; LICENSE and MAGPIE.md beside them), with one change: init
became loadDrafts behind a sync.Once, which Compiler.Compile calls
first; loadDrafts compiles the metaschemas through the unexported
compile exactly as init did. The Dockerfile copies third_party before
`go mod download`, which needs the replace's directory.

New TestAnswerSchemaCheckedAgainstItsDraft: three schemas that break
their draft (type 5, minLength "x", required "a" under 2020-12) are
refused. Broken by hand (Compile without ensureDrafts) it panics red.

Measured on mote, sandbox HOME, t45 (v0.1.3522) against t46 (this):
- GODEBUG=inittrace=1 sum: 2.98 MB / 28,515 allocs -> 1.28 MB / 7,385
- `magpie statusline`, 3 runs: instructions retired ~135M -> ~101M,
  peak memory footprint 15.5-16.1 MB -> 12.6-12.7 MB

Run: upstream's own tests (`go test .`, GOWORK=off) on the forked
draft.go and compiler.go: ok, as on upstream (36 pass; the official
JSON-Schema-Test-Suite submodule isn't in the module zip, so it wasn't
run). go vet ./... ok; GOOS=windows go vet ./internal/gateway ok;
go test -run 'TestAnswer|TestClaudeTUISchema' ./internal/gateway ok;
root TestNoEagerPackageRegexps, TestAllLazyPatternsCompile ok.
Not tried: a docker build of the Dockerfile.
2026-11-10 13:16:59 +08:00
bbornandClaude Opus 5.5 ae7dc10ae2 docker: the image is Debian 12 slim, so the Cursor and Devin CLIs magpie installs at sign-in run in it (#2834, bborn2)
magpie installs a subscription's CLI at sign-in with its vendor's
`curl … | bash` (internal/provider/install.go: Cursor, Devin, Grok
Build). The distroless image had no curl and no /usr/bin/env (the
installers' shebang), so that install couldn't run there, and only
Grok Build had a native fallback. bborn2 reported that a Cursor CLI
installed by hand failed with "cannot execute: required file not
found". The image is now debian:12-slim with ca-certificates and
curl. It keeps the nonroot user at uid/gid 65532, HOME and XDG under
/config, the healthcheck, and magpie on PATH. Size: 157MB against
82MB for origin/main's image, both built here on arm64. Running a
feature magpie offers is worth the 75MB.

Changed in review: dropped the branch's GOPROXY build arg, a separate
goal. The comments in install.go and install_test.go that said the
image has no curl now say "had". docs/reference.md and the site's
Docker page (en, zh, ja) say Debian with bash and curl instead of
distroless with busybox.

Run, with OrbStack's docker:
- docker build of this tree and of d783df46c's Dockerfile: 157MB vs
  82MB.
- docker run of the new image: health "healthy", user nonroot (id
  65532). `curl https://cursor.com/install -fsS | bash` exit 0, then
  `~/.local/bin/cursor-agent --version` printed 2026.10.16-e3cb207.
  Devin's install.sh installed devin v3000.11.92 (its trailing
  `devin setup` said "Login canceled" with no terminal, as on any
  host). `devin --version` printed 3000.11.92. bash and `magpie
  version` run.
- Old image: `which curl` finds none, and /usr/bin/env doesn't exist.
- A volume written by the old image (file owned 65532) was read and
  written by the new image.
- gofmt -l clean; go vet darwin, linux (nogui) and windows clean.
- Full `go test -tags nogui -timeout 45m ./...`: every package ok
  except internal/agent and internal/gateway, which timed out at 45m
  mid-test (TestConnectSaysHow, TestLargeRequestEndpoints) under a
  load average of about 200 from parallel suites. This commit changes
  no code those packages build, only comments in internal/provider,
  which passed (992s), so they weren't rerun.
Not tried: a Grok Build install inside the image, and a full
in-magpie Cursor/Devin sign-in with a real account in the container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 00:19:53 +08:00
yetone 7bfe3137bd docker: the image has bash and busybox, so a terminal in the container opens (スライム on Discord: 这2天的docker版更新后无法进入terminal模式,导致配置不了devin … exec: "/bin/bash": stat /bin/bash: no such file or directory)
The image is distroless, which has no shell at all, so a NAS panel's
terminal (Synology, 1Panel, Portainer open /bin/bash or /bin/sh) and
`docker exec -it magpie bash` failed, and a sign-in that needs a terminal
(magpie accounts add devin) couldn't be made there. The image now copies
in Debian 12's bash with the libtinfo it links (distroless cc is Debian 12,
so its glibc runs it) and busybox's commands, and puts magpie on PATH
(/usr/local/bin/magpie). The image still runs as nonroot and starts
/magpie serve as before; it grows from about 37 MB of extras to 66.6 MB.

Built locally (docker 29.4, arm64): bash 5.2.15 and sh run as uid 65532,
`magpie version` and `magpie healthcheck` work from bash, the gateway
answers 200 on /v1/models, /config keeps its folders. The Docker workflow's
smoke test now runs bash and sh in the container. README says so.
2026-10-05 03:23:18 +08:00
yetone 0bb119f87f docker: sign-ins and plugins survive a restart, and the image checks its own health (Jorben on Discord) — only /config was a volume, while HOME (/home/nonroot) held the agents' sign-ins (~/.codex, ~/.claude…) and the cache held Bun: a new container lost them all, and distroless/static has no libc, so the Bun magpie downloads couldn't start (fork/exec … no such file or directory). HOME and XDG cache/data/state now live under /config (made on start, so an old volume keeps working), the base is distroless/cc (glibc), and magpie healthcheck backs a HEALTHCHECK with no curl needed. Verified in Docker: an old volume carried over, a market plugin installed and stayed across a recreate without downloading Bun again, the container reported healthy. TestHealthcheck and TestMakeDirs fail without the change. 2026-10-01 11:38:37 +08:00
1a704bd6ba docker: a server image and a multi-arch build workflow (#245)
* docker: a server image and a multi-arch build workflow

The image is the terminal-only binary built with -tags nogui on
distroless static, run as nonroot with magpie's files on a /config
volume, created and chowned at build time so a fresh named volume
is writable by uid 65532.

The workflow builds amd64 and arm64 on native runners, smoke-tests
each image before anything is pushed (ready probe, unknown-model
4xx JSON, /config write), pushes by digest, merges a multi-arch
manifest (semver trio plus latest on v* tags, edge otherwise) and
attests build provenance. PR runs build and smoke-test only.

The README documents running the image, the web UI mode, and why
subscription sign-ins must start where a browser shares loopback
with magpie.

Co-Authored-By: glm-5.3-flash <hakase@ooooo.space>
Generated-By: omp 18.4.3

* docker: README publishes the ports on the host's loopback and says how to require a key — until the gateway is shared from Settings it takes any key from anyone who reaches it, and Docker's -p 3425:3425 puts it on every interface of the host past its firewall. Checked in the built image: with settings lan+lanKey a request from the host through the published port without the key gets 401 and with it 200; without them any key gets 200.

---------

Co-authored-by: glm-5.3-flash <hakase@ooooo.space>
Co-authored-by: yetone <yetoneful@gmail.com>
2026-09-30 03:21:19 +08:00