docker-in-machine
यह क्या करती है
यह दिखाती है कि smolvm वर्चुअल मशीन के अंदर Docker कैसे चलाएँ और जाँचें कि कंटेनर वहाँ चलते हैं। यह उन डेवलपर्स के लिए है जिनके टेस्ट या बिल्ड को Docker चाहिए।
कब इस्तेमाल करें
- ✓जब कोई टेस्ट सूट या बिल्ड मशीन के अंदर कंटेनर शुरू करना चाहता हो।
- ✓जब Docker पहली बार चला लेकिन मशीन रोकने और चालू करने के बाद विफल हो गया।
- ✓जब आप जानना चाहते हों कि मशीन के अंदर Docker का स्टोर किया डेटा कहाँ रहना चाहिए।
Skill का लिंक
https://github.com/smol-machines/smolvm/blob/main/docs/docker-in-machine/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी टेस्ट मशीन के अंदर Docker चालू कीजिए, ताकि मेरा टेस्ट सूट अपने कंटेनर शुरू कर सके।”
हर हफ़्ते 5 नई skills, 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 तक नहीं। Windows मशीन के अंदर Docker daemon शुरू नहीं होगा।
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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
branch-and-checkpoint
6.9kयह आपके एजेंट को चल रही smolvm वर्चुअल मशीन को चेकपॉइंट के रूप में सहेजने, बाद में वापस लाने, रोकने और फिर चालू करने, और उसे कॉपी में बाँटने में मदद करती है।
coding-agent
6.9kयह आपके एजेंट को smolvm की सुरक्षित वर्चुअल मशीन के अंदर Claude Code जैसे कोडिंग एजेंट चलाने में मदद करती है, जिसमें आपका प्रोजेक्ट फ़ोल्डर माउंट होता है।
credentials
6.9kयह आपके एजेंट को आपकी key से API कॉल करने देती है, जबकि key कभी उसकी वर्चुअल मशीन के अंदर नहीं जाती, ताकि भरोसे के बाहर का कोड उसे न पढ़ सके।
dev-env
6.9kयह आपके एजेंट को smolvm की डेव मशीन में इंस्टॉल किए टूल बनाए रखना सिखाती है, ताकि वह जल्दी रीस्टार्ट हो और सत्रों के बीच पैकेज बने रहें।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।