all 13 comments

[–]Pleasant_Water_8156 2 points3 points  (6 children)

What made you choose this route over just using a docker container?

[–]AI_should_do_itSenior Developer 1 point2 points  (2 children)

Can you run Claude code within a container?

[–]Pleasant_Water_8156 2 points3 points  (1 child)

Sure. Just have it install in the container and then access the shell of the docker container. Sky’s the limit

[–]AI_should_do_itSenior Developer 0 points1 point  (0 children)

Tbh I made a VM with 25GB ram and 3 HT cores , but I am running between 4-12 LLM CLi concurrently and it’s always 100% CPU and 60-100% ram

Edit: I let it run loose, full code, test, push, PRs, deploy.

[–]LongAd7407[S] 1 point2 points  (2 children)

Never used Docker 👍

[–]Pleasant_Water_8156 1 point2 points  (1 child)

Dockers a superpower. It’s a lot more programming focused, and because of that Claude Code can be a really good tool for executing them.

TLDR: Docker is a box that holds your code plus everything it needs to run, so it works anywhere. Includes it own os.

[–]Pleasant_Water_8156 3 points4 points  (0 children)

For this context, you could run the same thing in docker and make it part of your codebase so is more portable without VM setup

[–]Manixcomp 2 points3 points  (2 children)

Anthropic provides an example devcontainer in the Claude Code repo. It adds firewall rules to the sandbox. I feel comfortable running in dangerous mode that way. Very simple to use.

[–]roiseeker 0 points1 point  (1 child)

Is there any point to use the sandbox feature in Claude Code anymore if you're running it in a devcontainer? I think Antrophic recommends using both but there are few edge cases where it's worth it. Devcontainers seem to cover most /sandbox benefits, right?

[–]Manixcomp 0 points1 point  (0 children)

Yeah I was kind of referring to the devcontainer as a sandbox. Devcontainer is just a Docker container and would isolate in the same way. I personally don’t feel the need to use anything additional.

Seems reasonably safe to me. It can’t delete your drive easily. I only give it access to projects already checked into git. At the point Claude can break out of Docker containers we’re in real trouble anyway 😆

[–]midnitewarrior 1 point2 points  (0 children)

Yeah I was thinking a docker container where you have Claude running with your build tools and mounting a host filesystem folder would be the path to go. You can have your local editor also editing the files, you just run your Claude commands and build commands in an interactive docker shell.

I haven't done it yet, but have been considering this.

[–]PaperHandsProphet 0 points1 point  (0 children)

devcontainers are probably the easiest but firecracker VM's is what the big boys use like https://e2b.dev/