EQTY LabDocs

docker eqty

Reference for the docker eqty CLI plugin, which starts the TPM-enabled Docker VM on a Mac on demand and runs commands in it, and for its settings.

View as Markdown

docker eqty is a Docker CLI plugin, also runnable standalone as docker-eqty, that runs Docker commands against the notary-backed TPM VM on a Mac. It starts the VM if it is stopped, creating the vTPM on first use, and leaves your default Docker context as it was. It is installed by the eqty-docker package; see the Quick Start.

sh
docker eqty use vz                     # once: pick the Virtualization.framework flavour
docker eqty run --rm hello-world       # starts the VM first if needed
docker eqty compose up -d
docker eqty status
docker eqty stop

Every command that is not one of the plugin’s own below goes to the TPM VM’s Docker context. Compose files pass through unchanged.

Commands

CommandWhat it does
use vz|qemu [vm name] [vtpm id]Picks the flavour: vz is a Virtualization.framework VM through vfkit, qemu a Colima VM. Optionally names the VM and its vTPM. Saved in ~/.config/docker-eqty/config.
startStarts the VM: starts the vTPM and, on vz, resets it, measures the launch and starts the relay. Checks Docker and guest notary readiness.
stopStops the VM.
statusrunning or stopped, with the flavour, VM, vTPM and Docker context.
verifyRuns the flavour’s verification script: TPM checks from a container and, on vz, the launch measurements and IMA replay.
settings [show [--json]]Shows the effective VM settings.
settings set Key=value ...Changes settings for the next start.
settings share add|remove DIREdits the shared directories.
settings resetBack to the defaults.
run, create (also container run|create)Passed to Docker with -e ENDPOINT=http://100.100.100.200:8066, the guest notary, added, and --device /dev/tpm* refused, so containers use the guest notary rather than the raw TPM. EQTY_ALLOW_TPM_DEVICE=1 allows the device.

Defaults: flavour vz; VM vz-tpm for vz and the Colima profile tpm for qemu; vTPM docker-vz or docker-tpm.

Environment

VariableMeaning
EQTY_FLAVOURvz or qemu; overrides the saved flavour.
EQTY_VMThe VM name, or Colima profile.
EQTY_VTPMThe notary vTPM id.
EQTY_ENDPOINTThe guest notary URL injected into run. Default http://100.100.100.200:8066.
EQTY_ALLOW_TPM_DEVICE=1Let run pass /dev/tpm* to a container.

Settings

Settings apply to the vz flavour and use Docker Desktop’s key names, so a settings.json from Docker Desktop reads the same. They live in ~/.config/docker-eqty/settings.json and apply at the next docker eqty start. The defaults match Docker Desktop’s.

KeyDefaultEffect
Cpusevery corevfkit --cpus; 1 to this Mac’s core count.
MemoryMiBhalf of the Mac’s memoryvfkit --memory; at least 1024, leaving macOS 1024.
SwapMiB0A swap file on the Docker data disk, sized by the guest at each start. 0 removes it.
DiskSizeMiB65536The Docker data disk’s logical size. Grows an existing disk at the next boot; never shrinks.
FilesharingDirectories/Users, /Volumes, /privateDirectories shared with the guest over VirtioFS, read-write. Under /Users and /Volumes they mount at their own path; anything else under /host_mnt/<path>, with bind sources translated by the Docker API proxy, as Docker Desktop does. A bind source that does not exist on the Mac and lies in a Linux system directory such as /var/lib, /proc or /etc is left alone and means the VM’s path, so cAdvisor’s /var/lib/docker and node-exporter’s /proc work; /var/run/docker.sock always means the engine socket. A directory inside another share is covered by it.
FilesharingImplementationvirtiofsThe only implementation; gRPC FUSE and osxfs are refused.
UseRosettatrue when Rosetta is installedvfkit attaches Apple’s Rosetta share; the guest registers it as the x86-64 ELF handler, so --platform linux/amd64 containers run. Install Rosetta with softwareupdate --install-rosetta --agree-to-license.
VmBackendvzThe plugin’s flavour, vz or qemu; setting it is docker eqty use. Docker VMM has no counterpart and is refused.
SynchronizedFileShares[]Accepted with a warning, not implemented.
sh
docker eqty settings set Cpus=4 MemoryMiB=4096 SwapMiB=1024
docker eqty settings share add /Volumes/Data
docker eqty settings reset

What the VZ flavour provides

With the vz flavour, docker eqty gives the usual Docker-on-Mac experience with these pieces in place:

  • A local Docker socket. A Mac proxy carries Docker API traffic over vsock to a small proxy in the guest. The vz-tpm Docker context points to it. Every API connection is a channel on one long-lived vsock stream with per-channel flow control: vfkit dials the guest once per vsock connection, and that dial stalls for good once a few dozen are in flight at the same time, as with docker stats over many containers, export | import or parallel docker run; one stream never trips it. A guest image from before the multiplexer still works, because the Mac proxy falls back to one connection per request when its EQTY-MUX/1 greeting goes unanswered.
  • Published ports. A Mac process follows the Docker events stream and mirrors published TCP and UDP ports to the Mac the moment a container starts, including the ingress ports of swarm services, which belong to no container. A port published on all addresses is relayed to the VM’s address directly and is reachable from other machines on the Mac’s network, as with Docker Desktop; publish as 127.0.0.1:8080:80 to keep it local. A port already used by a Mac service is refused and logged once.
  • host.docker.internal and gateway.docker.internal reach the Mac, for services that accept connections from the local network. A Mac service bound to 127.0.0.1 only is not reachable this way. macOS Local Network privacy applies: Apple-signed programs and GUI apps granted the permission accept the VM’s connections; a Homebrew CLI started from an SSH session does not.
  • Docker Desktop’s daemon defaults. At boot the guest writes "log-driver": "local" into daemon.json, since the json-file driver halves a container’s stdout throughput to the Mac and grows without bound, and "default-stop-timeout": 3 when its dockerd knows the key. For an engine that does not, the Mac proxy puts StopTimeout: 3 on every container that sets none, so docker stop and compose down kill a SIGTERM-ignoring container after 3 seconds as Docker Desktop does, not after the engine’s 10. A compose stop_grace_period or --stop-timeout still wins.
  • inotify for Mac edits. VirtioFS shows the guest a changed file but emits no inotify event for it. A Mac process watches the shared directories with FSEvents and tells the guest which paths changed; the guest re-applies each file’s timestamps, which inotify reports as a change, so hot-reload tools work. Nothing is written to the Mac.
  • An egress check at start. The guest connects to a public resolver over IPv4 and IPv6 and resolves a name, and start warns when IPv4 or DNS fails. A vmnet fault that leaves only IPv6 looks like slow builds otherwise; stop and start the VM.
  • The notary address stays local. The guest pins 100.100.100.200 to its loopback, so the ENDPOINT containers are given always resolves to the guest notary.

How the two flavours compare with Docker Desktop is in the appendix.

Files

PathWhat
/opt/eqty/docker/The plugin, both flavours’ scripts, the VZ guest kernel with its BUILDINFO, the compressed guest image. Read-only.
~/.config/docker-eqty/config (flavour, VM, vTPM) and settings.json.
~/.local/share/eqty-vz-tpm/<vm>/The VZ VM: disk.raw (system), docker-eqty.raw (Docker data), the Docker socket, logs. Unpacked on first start.
~/.local/share/eqty-docker/Build output and results for the installed scripts.
sudo /opt/eqty/docker/uninstall.shRemoves the package. VM disks, Docker data, vTPMs and per-user settings stay in place.

An update stops running VZ VMs first and leaves existing per-user disks alone; only a missing system disk is unpacked from the bundled image.