docker-in-machine
하는 일
smolvm 가상 머신 안에서 Docker를 실행하고, 컨테이너가 그곳에서 돌아가는지 확인하는 방법을 보여 줍니다. 테스트나 빌드에 Docker가 필요한 개발자를 위한 스킬입니다.
사용하는 경우
- ✓테스트 모음이나 빌드가 머신 안에서 컨테이너를 시작해야 할 때.
- ✓Docker가 처음에는 잘 작동했지만 머신을 멈췄다 시작한 뒤 실패할 때.
- ✓머신 안에서 Docker의 저장 데이터가 어디에 있어야 하는지 알고 싶을 때.
스킬 링크
https://github.com/smol-machines/smolvm/blob/main/docs/docker-in-machine/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“테스트 머신에서 Docker가 실행되도록 해 주세요. 그래야 제 테스트 모음이 컨테이너를 시작할 수 있습니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 Docker 데이터를 머신의 디스크에 보관하고, 부팅할 때마다 Docker를 시작하는 설정 파일을 사용합니다. 그래서 재시작 후에도 Docker가 계속 작동합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
A Docker daemon inside a machine
Verified on smolvm v1.29.0 on macOS arm64, 2026-10-15, and on v1.18.2 on Linux aarch64, 2026-09-24; the Linux runs used
the Smolfile with memory = 1024, for a host reason given below. Done means docker info succeeds inside the guest, a nested container runs, and
Docker's data sits on the ext4 storage disk rather than the rootfs overlay.
The Linux runs used the scripts of their date; this version's preflight and cleanup scripts ran
on Linux aarch64 on v1.22.2 on 2026-10-03.
On Windows, up to and including v1.22.2, dockerd does not start in a machine. The Windows
guest kernel is built without bridge networking and POSIX message queues, so dockerd cannot
create its default network and, forced past that, containers still cannot be created.
references/windows.md has the evidence and the direct kernel probe, which gave the same answer on
v1.22.2.
Docker's data has to be on the machine's disk on every start
From v1.28.1 a disk volume, a guest path with no host side, is a directory on the machine's ext4
disk, bound into the workload on every start (#1787).
assets/docker.smolfile declares /var/lib/docker and /var/lib/containerd that way, and its
docker:dind image starts dockerd itself on every start, so nothing has to be re-applied after a
stop and start.
On v1.28.0 and earlier, init runs once, so the bind mounts are gone on the second boot and
have to be re-applied on every start. assets/docker-bind-mounts.smolfile is that configuration,
and scripts/start-dockerd.sh re-applies the mounts and starts the daemon, as the upstream
example's "Start dockerd" recipe does. Reproduced on both hosts on v1.14.2, v1.18.2 and v1.22.2,
on macOS on v1.16.1, and with that file on v1.29.0:
Init already completed, skipping 5 command(s)
NO_BIND_MOUNTS_AFTER_RESTART
DOCKERD_DOWN
Running scripts/start-dockerd.sh afterwards restored everything, and docker images still
listed alpine:latest, because the images are on /storage. The failure mode is a daemon that
will not start, or one running on the wrong filesystem, not lost data.
init runs on the first start only, as smolfile.md says, whatever
machine create --help said before v1.23.7. More in references/traps.md.
Procedure
1. Preflight.
scripts/preflight.sh
docker_in_machine=verified on macOS and Linux, unavailable on Windows with the reason.
2. Create. assets/docker.smolfile, for v1.28.1 and later, is docker:dind with the two disk
volumes. On v1.28.0 and earlier pass assets/docker-bind-mounts.smolfile, the upstream example's
configuration, shipped here because the release tarball does not contain examples/.
scripts/create-docker-machine.sh # name defaults to smolskill-docker
scripts/create-docker-machine.sh smolskill-docker assets/docker-bind-mounts.smolfile # v1.28.0 and earlier
With the bind-mount file the apk add docker happens on the first start and dominates the
time.
3. Wait for the daemon. Run this on every start, not only the first.
scripts/start-dockerd.sh
With the disk volumes it waits for the image's own dockerd to answer docker info. With the
bind-mount file, where nothing starts the daemon, it re-applies both bind mounts, clears a stale
pid file and starts dockerd with the overlay2 driver, printing starting dockerd on the bind mounts. On v1.29.0 with the volumes:
Server Version: 29.9.0
Storage Driver: overlayfs
Docker Root Dir: /var/lib/docker
server_version=29.9.0
result=dockerd_up
4. Prove it, on the right filesystem.
scripts/verify-docker.sh
storage_driver=ok (overlayfs)
docker_root_device=ok (/dev/vda)
pull=docker.io/library/alpine:latest
nested_container=ok (NESTED_OK)
host_network=ok (HOSTNET_OK)
host_socket=present (.../vms/<hash>/docker.sock)
result=docker_ok
overlayfs is the name Docker 29's containerd image store reports; Docker 25 on the bind-mount
file reports overlay2, and the check takes either.
docker_root_device is the check that matters. docker info succeeds while /var/lib/docker
sits on the rootfs overlay, and the failure that follows is confusing and much later.
5. Use it, and clean up only when it is no longer wanted. A machine someone asked for is the deliverable: leave it running and give them its name. Their own code
자주 묻는 질문
Windows에서도 되나요?
스킬에 따르면 1.22.2 버전까지는 안 됩니다. Docker 데몬은 Windows 머신 안에서 시작되지 않습니다.
Docker 데이터를 왜 디스크에 두나요?
머신의 디스크에 두면 머신을 멈추고 시작해도 데이터가 남기 때문입니다.
코딩 에이전트가 쓸 수 있나요?
네. 스킬은 컨테이너를 실행하는 에이전트를 사용 사례 중 하나로 듭니다.
상세 정보
작성자의 원본 설명
Runs a Docker daemon inside a smolvm machine and shows it working there, which is what tools that call Docker themselves need, such as a test suite that starts containers, an image build, or a coding agent that launches containers. Use when dockerd will not start inside a machine; when Docker worked on the first boot and broke after a stop and start; when deciding where Docker's data directory has to live; or when checking whether this is possible on a given platform at all. Do not use it to run OCI images, which smolvm boots natively without Docker, and do not attempt it on Windows, where the
repo: smol-machines/smolvm
인기도
- GitHub 스타
- 6.9k
- 순위
- #13718
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
branch-and-checkpoint
6.9k에이전트가 실행 중인 smolvm 가상 머신을 체크포인트로 저장하고, 나중에 복원하고, 일시 중지와 재개를 하며, 복사본으로 분기하도록 돕습니다.
coding-agent
6.9k에이전트가 Claude Code 같은 코딩 에이전트를 안전한 smolvm 가상 머신 안에서, 프로젝트 폴더를 연결한 채로 실행하도록 돕습니다.
credentials
6.9k에이전트가 내 키로 API를 호출하게 하되, 키는 가상 머신 안에 들어가지 않아 신뢰할 수 없는 코드가 읽지 못하게 합니다.
dev-env
6.9k에이전트가 필요한 도구를 설치해 둔 smolvm 개발 머신을 유지하도록 가르칩니다. 그래서 빠르게 다시 시작하고 세션이 바뀌어도 패키지가 남습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.