3.1 KiB
OpenCode isolated image builder — 2026-10-14
OpenCode uses a separate rootless OpenCode-BuildKit container on Unraid.
No host Docker socket, SSH identity, host network or workspace mount is supplied
to the builder. OpenCode transfers the requested build context through a Unix
socket. Build contexts must exclude secrets and irrelevant files via .dockerignore.
Image: moby/buildkit:rootless@sha256:65eca3c01cd1180c8f64565c4e3c5983af5145818b0e6fa863385d099eb73855.
Restart policy unless-stopped, bridge network, no published ports, 4 GiB RAM,
2 CPU equivalents. Non-privileged, UID 1000. Rootless operation requires
seccomp=unconfined and systempaths=unconfined on this container only.
Uses native snapshotter; no host Docker daemon access. Build processes still
share the host kernel. This is not a VM or unrestricted Docker-in-Docker.
Persistent host mounts:
/mnt/nvme-storage/appdata/OpenCode/buildkit/socket→/run/user/1000/buildkit/mnt/nvme-storage/appdata/OpenCode-BuildKit/cache→/home/user/.local/share/buildkit
Both mount roots owned by UID/GID 1000; socket directory mode 0700.
Daemon arguments: --addr unix:///run/user/1000/buildkit/buildkitd.sock --oci-worker-snapshotter=native.
Copy /usr/bin/buildctl from that pinned image into the existing OpenCode home
at /root/buildkit/bin/buildctl; install adjacent build-image from this repo.
These survive OpenCode recreation because /root is already persistent.
Usage in OpenCode shell:
cd /workspace/CasaDePrompt
/root/buildkit/bin/build-image casadeprompt:local ./casadeprompt-image.tar
The output is a Docker-loadable image archive, not an image installed in
Unraid's Docker daemon. No production container is started/replaced. A user or
administrator can later import the archive with docker load.
The client does not provide runtime container management.
Restore on Unraid: recreate the pinned builder with the settings above, restore OpenCode's home (client/wrapper/instructions) and cache if desired. Cache is disposable; do not restore an old live socket inode. Stop the builder before copying its cache. These Unraid files are not included automatically in Athena Deck's encrypted backup. For future native Debian OpenCode, install the pinned BuildKit binaries and RootlessKit for a dedicated non-root user, adjust client socket path and supervise the rootless daemon with a user systemd unit. That native installation and full-host restore have not been tested.
Unraid GUI template: /boot/config/plugins/dockerMan/templates-user/my-OpenCode-BuildKit.xml.
OpenCode global AGENTS.md contains the exact persistent wrapper path. No restart
was performed; an already active agent turn may retain previously loaded instructions.
Validation: builder worker reachable from OpenCode; BusyBox 1.37.0 Dockerfile
built with an actual RUN instruction creating /proof.txt. Exported archive
manifest and layer inspected independently; marker content matched BUILD_OK.
Only own temporary smoke context/archive removed afterward. CasaDePrompt itself
was not built or deployed in this integration check.