Files
devvm/internal/image
w3cjandClaude Opus 5.5 9ec1601801 feat(docker): an experimental Docker backend, its containers and native features
Each VM is a container from an image devvm builds by running its scripts
in a container and committing it. A container is not a VM: on Linux it
shares the host's kernel, on macOS Docker Desktop's one VM; docker.md says
so first.

- internal/backend/docker: build-image (docker commit; base from Ubuntu's
  image by digest, prepared by the container scripts smolvm shares, now in
  assets/container), from (any image Docker has or pulls), clone,
  project-mount and agent-folders (bind mounts), tools-share (tool images
  unpacked into a volume by a network-less container, linked by
  guest/tools.sh; ToolFormat dir-<unpack.sh>), cpus and memory (docker
  update). Build confinement native only on a rootful engine of this
  Linux machine; Docker Desktop and other engines build nothing yet.
- Containers run --init and a sleep; services.sh after each start, without
  Docker's daemon. Mounts and network are hashed into a label; a start that
  finds them changed commits the container and makes it again under the
  same name (flattened past 100 layers), its home a per-VM volume.
- The VM's user has the host's uid, and on Linux its gid. A --clone VM's
  clone gets a volume (VMSpec.CloneAt).
- Disk none: DiskUser reports what a VM holds (devvm size's disk_used),
  warned past base's disk by launches and ls; a default disk size is left
  out of a new VM on such a backend, said.
- Everything labelled devvm.data=<data folder>; only labelled resources
  are touched; names Docker shares between users carry its hash.
- Problems: docker on PATH, a reachable engine (or the docker group fix),
  29.1+, Linux containers, this machine's arch; Report names the engine and
  Docker Desktop's file sharing, which CreateVM checks.
- ssh, ports, ports-all, agent forwarding and toggling, egress-proxy, disk
  and the new docker-layer feature are none: refused in one line. Builds
  ask for build features only when they build, so a built image works
  where it couldn't be built.
- testdata/stubs/docker: a stateful engine; docker.txtar; unit tests;
  tests/e2e.sh --backend docker on a Linux engine in a Lima VM e2e keeps
  (~/.lt-e2e-go-docker) and on Docker Desktop, with images copied from the
  Linux run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 08:54:04 -06:00
..