Files
devvm/testdata/script/root.txtar
T
w3cjandClaude Opus 5.5 1917072228 refactor(backend): remove the Docker backend
devvm is about VMs, and Docker's containers aren't VMs: Lima is the
default backend and smolvm stays experimental. The backend architecture
(Backend, Caps, Require, the registry, backendtest.Fake) stays, so
another backend is an addition.

Removed:
- internal/backend/docker, its registry entry and Names/Experimental's
  docker half; devvm _docker-connect and _docker-ports
  (internal/cli/dockerssh.go); assets/docker/unpack.sh.
- Test-build overrides DEVVM_DOCKER_KIND, DEVVM_DOCKER_PROC_SYS,
  DEVVM_LINUX_BUILD_URL/_SHA256, the registry.linuxURL/linuxSHA256
  ldflags vars and the CLI tests' Linux-build archive (linux_release).
- Interfaces only Docker implemented, with their callers:
  backend.ProxySocket/ProxySocketOf (the proxy's -listen-unix),
  DiskUser (ls's and size's disk-over warning, size's disk_used and
  --json disk_used_gib), Reporter (doctor), LeftoverLister and Leftover
  (gc --orphans' volumes, networks, containers and images),
  DockerLayerVM and VMSpec.DockerLayer, SSHTarget.ProxyCommand and
  vmssh.SSH.Proxy, vmssh.SSH.SessionArgs, CacheEntry.Name.
- The docker layer's runtime on a backend that makes VMs for it:
  vm/dockerlayer.go, KeyDockerLayer, chooseNet's refusal (chooseNet
  returns a bool now), the refusals at start and devvm network on, ls's
  "(sysbox)" and --json docker_layer, size_disk_default_unused.
- The proxy's relay mode (relay.go, -relay, -relay-to, -listen-unix).
- paths.Dirs.Docker and paths.VM.Lifeline.
- assets/guest/tools.sh's linked-folder branch; services.sh's
  DEVVM_LOOP, DEVVM_DOCKERD and DEVVM_SSHD=inetd.
- Messages: every docker_* the backend used, docker_layer_runtime,
  net_docker_layer, net_off_docker_layer, committing_image,
  pulling_image, unpacking_tools, disk_over, size_disk_default_unused,
  gc_orphan_volume/_network/_container/_image, docker_connect_failed;
  gc_orphan_elsewhere reworded.
- Tests: docker.txtar, the docker stub's engine (its --from half
  stays), the ssh stub's login-shell branch; e2e's --backend docker,
  --engine, the docker host VM and Docker Desktop runs.
- Release: one GoReleaser pass, no Linux-build pin in the macOS builds,
  no Linux devvm in the Homebrew formula's libexec. Linux builds stay.
- Docs: backends/docker.md and internals/docker.md, design.md's Docker
  notes, the Docker column of the feature table, and every page's
  mentions of the Docker backend, Docker Desktop as one, and Sysbox.

Kept: the docker layer in Lima VMs, devcontainer docker-in-docker,
--from with images only a local Docker has, Docker Hub references.

State written by a Docker VM before this reads as an unknown backend
(backend_unknown_vm).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 10:26:07 -07:00

96 lines
3.2 KiB
Plaintext

# devvm --help prints usage.
exec devvm --help
stdout '^Usage:'
stdout '^ devvm \[flags\]$'
! stdout 'IMAGE\]'
! stderr .
cp stdout help.txt
# So do devvm help and -h; devvm help COMMAND prints the command's.
exec devvm help
cmp stdout help.txt
exec devvm -h
cmp stdout help.txt
exec devvm help build
stdout 'devvm build IMAGE \[flags\]'
exec devvm build --help
stdout 'devvm build IMAGE \[flags\]'
! stub_calls
# An unknown flag is a usage error: its message on stderr, then the line
# naming the command's own help.
! exec devvm --nope
cmp stderr nope-flag.txt
! stdout .
! exec devvm stop --nope
stderr '^devvm: flag_unknown command=devvm stop flag=--nope$'
stderr '^usage_help command=devvm stop$'
# So is a command given too many arguments, naming those its help shows.
! exec devvm build a b
cmp stderr build-args.txt
! stdout .
! stub_calls
# devvm takes no word but a command's. A toolchain's, an agent's or a
# layer's name, or several joined with + or a comma, is a usage error
# naming devvm's --help that points to the flags choosing them; any other
# word gets a did-you-mean when a command is close. Nothing runs.
! exec devvm node
stderr '^devvm: no_command_part flags=--tools node word=node$'
stderr '^usage_help command=devvm$'
! exec devvm claude
stderr '^devvm: no_command_part flags=--agents claude word=claude$'
! exec devvm docker
stderr '^devvm: no_command_part flags=--layers docker word=docker$'
! exec devvm node+claude
stderr '^devvm: no_command_part flags=--tools node --agents claude word=node\+claude$'
stderr '^usage_help command=devvm$'
mkdir $XDG_CONFIG_HOME/devvm/layers
cp $WORK/pg.sh $XDG_CONFIG_HOME/devvm/layers/pg.sh
! exec devvm pg,node
stderr '^devvm: no_command_part flags=--tools node --layers pg word=pg,node$'
! exec devvm node+nope
stderr '^devvm: no_command word=node\+nope$'
! exec devvm stpo
stderr '^devvm: no_command_like command=stop word=stpo$'
stderr '^usage_help command=devvm$'
! stdout .
! stub_calls
# Flags for a new VM are devvm's alone, so other commands refuse
# them, before or after the command's name.
! exec devvm ls --cpus 4
stderr '^devvm: flag_unknown command=devvm ls flag=--cpus$'
! exec devvm --cpus 4 ls
stderr '^devvm: flag_unknown command=devvm ls flag=--cpus$'
! exec devvm restart --backend lima
stderr '^devvm: flag_unknown command=devvm restart flag=--backend$'
! exec devvm tools add node --from node:24
stderr '^devvm: flag_unknown command=devvm tools add flag=--from$'
# A backend that isn't one is refused first too.
! exec devvm build --backend nope base
stderr '^devvm: backend_unknown backends=lima, smolvm name=nope$'
stderr '^usage_help command=devvm build$'
! stub_calls
# No flag or argument takes an empty value to mean none or its default.
! exec devvm --ports ''
stderr '^devvm: flag_blank flag=ports$'
! exec devvm --cpus=
stderr '^devvm: flag_blank flag=cpus$'
! exec devvm ''
stderr '^devvm: arg_blank command=devvm$'
! exec devvm history export ''
stderr '^devvm: arg_blank command=devvm history export$'
! stub_calls
-- nope-flag.txt --
devvm: flag_unknown command=devvm flag=--nope
usage_help command=devvm
-- build-args.txt --
devvm: args_too_many args=IMAGE command=devvm build given=a b
usage_help command=devvm build
-- pg.sh --
set -euo pipefail