Live data from Hacker News

Docker Sandboxes – Disposable, isolated sandboxes for AI agents

docker.com

311–320 of 416 posts

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#311

Reminds me of sandboxy - https://github.com/apple/containerization/tree/main/examples... Also if your thing doesn't work with `pi` out of the box, then low effort

Just put the following to your `.config/sandboxy/agents/pi.json`

{ "allowedHosts": [ ".anthropic.com", ".claude.com", ".pi.dev", "npm.org", ".npmjs.org", ".github.com", ".githubusercontent.com", ".pypi.org", ".pythonhosted.org" ], "baseImage": "docker.io\/library\/node:22", "displayName": "Pi", "environmentVariables": [ "IS_SANDBOX=1" ], "installCommands": [ "npm install -g --ignore-scripts @earendil-works/pi-coding-agent", "npm install -g global-agent" ], "launchCommand": [ "pi" ], "mounts": [ { "containerPath": "\/root\/.pi", "hostPath": "~\/.pi", "readOnly": false } ] }⏎

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#314

Does anyone have a solution for iOS development? I was all in on sandboxes and safehouse for my agents but the moment I got into iOS development it felt like my hand was forced to just run Claude / codex / pi directly on my machine because nothing else could do the dev loop. It’s been a painful reality for me, I’m going against core pieces of how I feel I should be interacting with agent harnesses and yet, I need to…

Hey, I work at Docker and my team works on mcp integration with sbx. A solution I've been trying is this: 1) Enable the xcode mcp server: https://developer.apple.com/documentation/xcode/giving-exter... 2) Add the xcode mcp server to sbx: `sbx mcp add xcode --command xcrun --args mcpbridge` 3) When you create the sandbox, use `--static-mcp xcode`. For example: `sbx create --static-mcp xcode claude .` Make sure you hav…

Also had this pain point as an sbx user. Given the risk this adds to the host, would be great if there were more docs on how to setup kits to make it safer (e.g. disable yolo mode).

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#315

I tried Docker Sandboxes but last time I checked you could not configure custom volume mounts, making more complex setups impossible. For work I need two directories for context for the agent to have access to…

This was added recently https://docs.docker.com/ai/sandboxes/usage/#multiple-workspa... ` sbx run claude ~/project-a ~/shared-libs:ro ~/docs:ro`

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#316
post #232

Earlier quoted context omitted.

I think Linux has a better solution than Docker. I wrote a tool to use `bubblewrap` to containerize any agent (at least all the agents I've used a couple of times), and bind mount the system stuff read-only, so the agent has your "usual" environment, but they can only see the project. Their history persists (either through a bind mount or a "shadow" copy of the history that only the wrapped agent sees), the agent can…

bubblewrap may work well for you and your specific workflows/projects but not in an enterprise setting where everyone already has a different setup on the host and needs something different inside the container. It's impossible to deploy a solution like that with bubblewrap -- configuration itself is going to be a nightmare. Which is why Docker Sandbox is aimed at teams/enterprises.

Yeah, Podman would be a better basis for that kind of use case. I'd built an early implementation of `flar` with Podman first, but it was more annoying than simply having my regular dev environment instantly available in the container. But if you need a bunch of different dev environments, instead of just your usual one, then sure, a bunch of different custom containers makes sense.

But, Docker is rarely the right way to manage containers on Linux, IMHO.

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#317

I tried it and it worked great at first but I had multiple issues with it, the disk space usage was growing significantly, I need to login multiple times for each sandbox, it's closed source and not possible to customize to my need. One other thing, I want to be able to handle multiple repos in the same sandbox and have a standard workflow around worktrees (one worktree per repo, all the worktree mounted in the VM).…

"login multiple times for each sandbox"

I've been using sbx for a bit now, and there have been some old versions that had this problem, but haven't had this problem in a while when using secrets https://docs.docker.com/ai/sandboxes/get-started/#authentica...

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#318

I work at Docker. Lot of valid and useful feedback here that we're looking closely at. One correction: this isn't containers. Each session is a microVM with its own kernel on the platform's native hypervisor: Hypervisor.framework, WHP, KVM. We wrote a new VMM (not Firecracker) to make it more effective across platforms. Explained a bit more here about the architecture and why those choices were made: https://www.dock…

Why’s it not on Linux? What are the difficulties with that platform?

Linux is available today (Ubuntu): github.com/docker/sbx-releases. Our webpage showing only brew and winget is on us.

For the people upthread who asked about on customization: templates (like snapshotting a running sandbox) and kits (YAML applied at creation like install steps, files, network and credential rules, or define a new agent outright) are the supported path now. It's early but take a look here: https://docs.docker.com/ai/sandboxes/customize/

On MCP, since credential handling was mentioned here: the sandbox sees one gateway endpoint, and OAuth tokens stay in the host credential store rather than in the VM. https://docs.docker.com/ai/sandboxes/mcp-gateway/

All this is early. We're looking at more based on feedback from users like running sandboxes in the background for long-horizon work and a lot more (including what you all raised in the thread here). Keep them coming.

Re: Docker Sandboxes – Disposable, isolated sandboxes for AI agents

#320
post #232

Earlier quoted context omitted.

bubblewrap may work well for you and your specific workflows/projects but not in an enterprise setting where everyone already has a different setup on the host and needs something different inside the container. It's impossible to deploy a solution like that with bubblewrap -- configuration itself is going to be a nightmare. Which is why Docker Sandbox is aimed at teams/enterprises.

Yeah, Podman would be a better basis for that kind of use case. I'd built an early implementation of `flar` with Podman first, but it was more annoying than simply having my regular dev environment instantly available in the container. But if you need a bunch of different dev environments, instead of just your usual one, then sure, a bunch of different custom containers makes sense. But, Docker is rarely the right wa…

"Docker Sandbox" is not docker. Completely different (and almost unrelated) products.
Post reply on HN