docs: document how to let the agent use Docker in Agent Canvas - #774
Merged
Conversation
The capability exists in the Canvas image but is undiscoverable: the documented `docker run` grants no privilege, so dockerd cannot start, and the only writeup lived under enterprise/ where a self-hoster would not look. Adds a section to the Canvas Docker guide explaining what the capability is for, that it needs --privileged, the security cost of that, and why no safer middle ground exists. Cross-links both ways with the Enterprise guide, which achieves the same thing unprivileged via a hardened runtime.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Agent Canvas image ships Docker, but the agent cannot use it as documented — the
docker runin our Docker backend guide grants no privilege, sodockerdfails:It does work if the user adds
--privileged(verified against publishedlatest-python: daemon 29.7.2 starts normally). But nothing told them that. The onlywriteup is
enterprise/docker-in-sandbox.mdx, where a self-hoster would not look, and noCanvas page mentioned
--privilegedat all.So a genuinely useful capability — build a
Dockerfileand run it to prove the changeworks, bring up a
docker composestack to reproduce a bug, use an image-only toolchain— was reachable only by users who worked it out themselves.
What this adds
openhands/usage/agent-canvas/backend-setup/docker.mdx— a "Let the Agent UseDocker" section covering:
--privileged, with a completedocker run<Warning>on the isolation cost, since this is a real security tradeoff on theuser's own machine
<Note>explaining that no safer middle ground exists, and pointing at howEnterprise does it unprivileged
enterprise/docker-in-sandbox.mdx— a reverse<Note>for readers who land therewhile self-hosting Canvas.
On "no safer middle ground"
Stated in the docs because it is the obvious next question, and it is measured rather
than assumed:
seccomp=unconfined,apparmor=unconfined,--device /dev/fuseand
--device /dev/net/tungets the daemon fully up ("Daemon has completedinitialization", server 29.7.2) — but containers it creates then fail with
error mounting "proc" to rootfs: operation not permitted.builder, with both
overlayfsandvfsstorage drivers.runcneedsCAP_SYS_ADMINto mount/proc, and privilege is granted by the host atcontainer start — it cannot be acquired later. That is what the Enterprise hardened
runtime provides at host level, and it is not something an image can ship.
Caveat worth knowing: these were run on Docker Desktop for macOS, where the outer
container already sits in a VM. On a native Linux host with unprivileged user namespaces
enabled, rootless may get further. The docs therefore describe
--privilegedas thesupported path rather than claiming rootless is impossible everywhere.
How to Test
Check both new cross-links resolve in the preview — the Canvas anchor
(
#let-the-agent-use-docker) and the Enterprise page link.Issue Number
Relates to OpenHands/software-agent-sdk#4643