Guide · Agent skill
How to use the Docker Inside a smolvm Machine agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains the docker-in-machine agent skill, which sets up a small Linux virtual machine with smolvm, starts a Docker engine inside it, and checks that containers really run. It is for developers whose tests, image builds or coding agents need Docker but should stay isolated inside a machine. By the end you will know how to install the skill, ask your agent for it in plain language, and confirm the result yourself.
Quick start
- 1Install the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
- 2Check the platform. Ask the agent to run the preflight script. It should report verified on macOS or Linux and unavailable on Windows.
- 3Create the machine. Have the agent create the smolskill-docker machine from the Smolfile that matches your smolvm version.
- 4Start the daemon. Run the start script so that dockerd comes up. Run it after every stop and start, not only the first time.
- 5Verify the setup. Run the verify script and confirm the result line reads docker_ok, with docker_root_device on /dev/vda.
- 6Use or clean up. Copy in your code and run it inside the machine, or run the cleanup script with --purge when you no longer need the machine.
What the skill makes the agent do
An agent skill is a folder of instructions and scripts that an AI agent loads when a request matches it. This one teaches the agent to run a Docker daemon (dockerd) inside a smolvm machine. Tools that call Docker themselves, such as a test suite that starts containers, an image build, or a coding agent that launches containers, need that daemon to exist.
The skill's own checks define success: docker info succeeds inside the guest, a nested container runs, and Docker's data sits on the machine's ext4 storage disk rather than the rootfs overlay.
- Set up the machine with a Docker image and two disk volumes for Docker's data
- Wait for the daemon to come up on every start
- Prove that containers run and that Docker's data is on the right disk
- Clean up the machine only when it is no longer wanted
Install the docker-in-machine skill
Download the ZIP for this skill from this page. Then add it to your agent in one of two ways.
For Claude Code, unzip the folder into ~/.claude/skills/ to make it available for you everywhere, or into a project's .claude/skills/ folder to make it available only in that project. For the Claude apps, upload the skill under Settings → Capabilities → Skills.
- Personal: ~/.claude/skills/
- Single project: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills, then upload
Know what you need before you start
The skill needs the smolvm binary installed on the host. It has been verified on macOS (Apple Silicon) and on Linux (aarch64). Its scripts run in a Bash shell, and the machine needs internet access to pull images such as docker:dind and alpine.
A Docker client on the host is optional. It is only needed if you want to use the host-side socket, and the skill does not verify that path.
Windows is not supported. The bundled guest kernel cannot run dockerd there, so the skill stops at its preflight step.
- smolvm binary
- Bash shell for the provided scripts
- Internet access to pull images
- Optional: a Docker client on the host
Run the setup scripts in order
The skill runs a fixed sequence. Start with the preflight check, which reports whether this platform can run Docker inside a machine. On macOS and Linux it reports verified; on Windows it reports unavailable with the reason.
Next, create the machine. On recent smolvm releases the default configuration is assets/docker.smolfile, which uses the docker:dind image with two disk volumes. Older releases need assets/docker-bind-mounts.smolfile instead. Then start the daemon and run the verify script. Verification pulls alpine:latest and checks the storage driver, the device under /var/lib/docker, nested container networking, and the host-side socket.
scripts/preflight.sh
scripts/create-docker-machine.sh
scripts/create-docker-machine.sh smolskill-docker assets/docker-bind-mounts.smolfile
scripts/start-dockerd.sh
scripts/verify-docker.shWhy Docker stops working after a stop and start
On older smolvm releases, init runs only on the first start. Bind mounts applied there are gone on the second boot, so Docker comes back with its data directory on the wrong filesystem or with no running daemon. The symptoms are a daemon that will not start, or one that is running on the wrong filesystem. Your images are not lost, because they live on /storage.
The fix is to run scripts/start-dockerd.sh after every start. It re-applies the bind mounts, clears a stale pid file, and starts dockerd. On recent releases that use disk volumes, the image starts the daemon itself, but the script still waits for it to answer.
scripts/start-dockerd.shWhere Docker's data has to live
Docker's data directories, /var/lib/docker and /var/lib/containerd, must be on the machine's ext4 disk. The machine's rootfs overlay cannot be used as the upper layer for Docker's nested overlay. Both Smolfiles therefore set storage = 20 and place the directories there, either as disk volumes or as bind mounts from /storage.
The check that matters is docker_root_device. docker info can succeed while Docker's data still sits on the rootfs overlay, and the resulting failure appears much later and is hard to trace.
- Check that docker_root_device reports /dev/vda
- Do not rely on docker info alone
Use the machine and be careful with the host socket
A machine someone asked for is the deliverable, so leave it running and give them its name, which is smolskill-docker by default. Copy code in with smolvm machine cp, or mount a folder with -v when you create the machine, then run it with smolvm machine exec.
The host socket is useful but powerful. Setting docker_socket = true bridges the guest's Docker socket to a host path, and anything on the host that can open that socket can start containers inside the machine. Leave it off unless a host tool needs it. Also note that net = true gives the whole machine outbound access, which the setup requires for pulling images. Scope it with --allow-host where you know which registries are used.
- Copy files in: smolvm machine cp <file> smolskill-docker:/workspace/<file>
- Run commands: smolvm machine exec --name smolskill-docker -- ...
- Remove when finished: scripts/cleanup.sh --purge
D=$(smolvm machine data-dir --name smolskill-docker)
DOCKER_HOST=unix://$D/docker.sock docker psWhat people use it for
- A test suite that starts database or service containers through Testcontainers, run inside an isolated machine
- An image build that needs a Docker daemon, run without touching the host's Docker installation
- A coding agent that launches its own containers while staying sandboxed in a smolvm machine
- Evaluating whether smolvm can host sandboxed coding agents that need Docker
Frequently asked questions
Is the docker-in-machine skill free to use?
The skill's repository is licensed under Apache-2.0, as shown on its listing. The skill itself is free to install and use, but you still need the smolvm binary and internet access to pull images.
What do I need to run the docker-in-machine skill?
You need the smolvm binary, a Bash shell for the scripts, and internet access to pull images such as docker:dind and alpine. A Docker client on the host is optional and only needed for the host-side socket, which the skill does not verify.
Why does Docker stop working after I stop and start my smolvm machine?
On older smolvm releases, init runs only on the first start, so bind mounts disappear on later boots. Run scripts/start-dockerd.sh after every start to re-apply the mounts and restart dockerd. Your images are kept on /storage.
Can I run Docker inside a smolvm machine on Windows?
No. The skill says the bundled guest kernel on Windows cannot support dockerd, because it is built without bridge networking and POSIX message queues. The skill's preflight reports unavailable there.
Do I need this skill just to run a container image in smolvm?
No. smolvm can boot OCI images natively without Docker, so use this skill only when software inside the machine has to call Docker itself, such as Testcontainers, Compose or an image build.
Is it safe to expose the Docker socket to the host?
Be careful. docker_socket = true lets any host process that can open the socket start containers inside the machine and read what they can reach. Keep it off unless a host tool needs it, and treat root inside the guest as untrusted.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Choose this skill if you need Docker-dependent tests, builds or coding agents to run isolated inside a smolvm machine on macOS or Linux. Pick something else if you only need to run an OCI image, since smolvm can do that without Docker, or if you are on Windows, where the skill itself says it cannot work.
Download the skill