#container-use

1 messages · Page 2 of 1

dawn veldt
#

I mean the dev-setup.sh file can liklely be very similar if not the same across multiple repos/projects.

#

At least the way I'm currently trying to approach this.

restive pumice
#

That does sound a lot like it might be best in a container image, yeah

dawn veldt
#

Right, ok, so what would be the best approach to share an image? Ideally I would want to use a private registry, but that's also a bit clunky, which is why I wanted to initially avoid this.

#

I'm new to dagger, and didn't see the cu base images on my host docker. Can it pull / use an existing image I have on my host?

cosmic birch
dawn veldt
#

Ok, thanks. I'll play around with this a bit.

#

Will this also work, if I pre-build a local image and reference it that way? Or does it always pull from the registry?

cosmic birch
#

It needs to be pulled from a registry, unfortunately

dawn veldt
#

Ack. However, that might be tricker to do inside editors. I can see it being easier to set and inherit the env with something like claude caude. I'm thinking of the SSO case for ephemerial credentials.

cosmic birch
dawn veldt
#

So setup-commands are pre workspace/worktree setup and install-commands are post? I wonder if renaming them might make sense? To me they sound like the same thing without knowing what I know.

This is starting to have me thinking about optimization of stuff like npm install etc. where maybe a persistent volume for dependency cache would also help. How much effort would it be to have an option to specificy a way to have a persistent volume for a configured directories be?

cosmic birch
dawn veldt
#

I assume the setup-command is just after the container is created, but before the repo is setup?

cosmic birch
#

Regarding cache volumes -- not much effort

cosmic birch
#

Setup commands run when creating a new environment, after pulling the base image but before copying your code. Use these for system-level dependencies and tools.

#

Install commands run after copying your code to the environment. Use these for project dependencies and build steps.

restive pumice
#

Once we start thinking about cache volumes, I start thinking about real dagger module config support… like it’s not hard to cover the most popular toolchains, but arbitrary custom toolchains are gonna necessitate more programmability, no?

cosmic birch
#

I did some back and forth with claude and he agreed those names kinda make sense

cosmic birch
dawn veldt
#

setup definately conveys it comes before install, but I'm not sure it conveys where in the entire lifecycle so much.

restive pumice
dawn veldt
#

But wait, don't you need the repo to do a pip on a requirements file etc? which would be install not setup?

cosmic birch
cosmic birch
restive pumice
cosmic birch
#

and npm install would go into install as well

dawn veldt
#

Right, so the previous usage of setup-command had these examples but now it's purpose has changed.

cosmic birch
#

@dawn veldt Yeah I updated the docs as well in that PR ... turns out those examples were broken (AI generated)

#

reviewed all the examples, now they make sense -- thanks for spotting!

restive pumice
#

Those docs are literally 2 days old btw lol, early adopter penalty here, we’re actively iterating

cosmic birch
#

@dawn veldt environment configuration is literally from yesterday 🙂 sorry for the brokeness

cosmic birch
dawn veldt
#

Np at all

cosmic birch
#

@restive pumice @dawn veldt no second thoughts about setup vs install? I'll go ahead and merge that if not

dawn veldt
#

Naming is hard. I can't think of anything better atm. I'm sure I will at some point though ...

cosmic birch
#

Same ... probably shortly after releasing those names

dawn veldt
#

I was going to say setup is kinda like a build step, if you think in terms of an image, but it's not.

#

Only think I've got is system-command maybe?

cosmic birch
#

yeah the separation between the two is really for caching purposes ...

in theory you could put EVERYTHING into install

the problem is, every time the source code changes, you invalidate the cache, and install would re-run

#

so like ...

apt-get update && apt-get install python <-- should be in setup

pip install -r requirements.txt <-- should be in install

they both could be in install, but then you're re-installing python any time you make code changes, which is slow and unnecessary

dawn veldt
#

Curious on this. We use mise to install deps mostly. There would be an advantage of caching the installs of mise, but what would invalidate it? For example the invalidation would need to be based on a mise.toml which has versions.

cosmic birch
fathom parcel
frank sundial
# fathom parcel Can you once check your pm i just sent ?

hi @fathom parcel ! 👋

Just a heads-up that our team doesn’t monitor DMs. Since we support a large and active community, we prioritize helping folks in public channels where others can also benefit from the answers.

If you have a question or comment that can’t be shared publicly, feel free to email us at solutions@dagger.io, and we’ll be happy to help there!

cosmic birch
#

@dawn veldt Just released v0.3.1 with the install commands if you want to give it a try

dawn veldt
#

@cosmic birch - Tried the install_commands and for some reason it doesn't seem to run the script. Not sure what I'm missing.

cosmic birch
#

Also I think those commands should show up in “cu log” of the environment

dawn veldt
#

Nothing. I also set the install command to an invalid path and I don't even get an error. Seems like a noop. 😕

cosmic birch
#

Back, trying now

#

@dawn veldt Weird:

$ cu config install-command add 'false'
$ claude 'create an environment'

  ⎿  Error: failed to create environment: install command failed: exit code 1.
     stdout:
     stderr:
     input: container.from.withWorkdir.withDirectory.withExec.exitCode process "sh -c false" did not complete successfully: exit code: 1
#

@dawn veldt Oh! Perhaps Zed still has the old container-use mcp server around? Maybe restarting it will upgrade to v0.3.1

#

which would be consistent with it completely ignoring the new install_commands field

dawn veldt
#

facepalm that was it ...

fierce rivet
#

hey dagger team & peeps here, i have to say, this project is fucking amazing! i've been thinking for the longest time to build something like this and thank the heavens that this already exists. appreciate it. hope to contribute how i cnan 🙂

serene dirge
#

Jetbrains Junie MCP support has been announced today 🥳 https://youtrack.jetbrains.com/issue/JUNIE-26/Support-MCP-for-Junie#focus=Comments-27-12379308.0-0
Configuration for container-use is to be done like the attached screenshot (or in ~/.junie/mcp/mcp.json)
I haven't yet found a way to give guidelines, so it's not using container-use by default, but I'll have a deeper look.

edit: by adding some extra guidance in the ask to Junie like the block "ALWAYS use ONLY Environments..." junie is then using container-use as expected

swift sierra
#

Apologies if this has been asked before.

When developing web applications that require database services, I understand that with Dagger, we can define services and establish dependencies using methods like with_service_binding() to build the execution environment. ( As shown in the Cookbook | Dagger

Is it possible to achieve the same functionality with Container Use?

I am wondering if a combination of container-use config setup-command add etc. would not be enough to build a database service etc.

opaque zephyr
# swift sierra Apologies if this has been asked before. When developing web applications that ...

Yes, you're correct, Dagger does support defining services and cross-service dependencies via its API.

container-use doesn't expose that part of the Dagger API to users (yet). In container-use, there is only one container per environment, and your mechanism for configuring it is setup-command like you already know. In the future we plan on exposing more of Dagger's API, but at the moment there is a gap.

serene dirge
restive pumice
# swift sierra Apologies if this has been asked before. When developing web applications that ...

there is very basic, undocumented, experimental service support in container-use. we'd love your feedback on it but it's all pretty subject to change and has rough edges (eg container-use terminal <env> doesn't bring back your services iirc) but you can prompt engineer things like "attach me a postgres service and configure my tests to point at it", verify it all works, and then container-use config import <env> and it'll save the service configuration so that new envs for that repo will come with that postgres container (and the env vars to point things at it)

like solomon said, no cross-service dependencies yet, and no explicit access to things like service bindings or the rest of the programmability of the dagger api, but the bare minimum that we do have in there is designed to meet your use case provided you're just looking for attached, ephemeral db containers like you'd use in a local dev setup

frank sundial
#

@zenith agate here is where all the fun CU stuff happens 🙂

zenith agate
#

yeah in the call today I expressed my desire to see CU evolved in to be a tool to "containerize" AI agents for security and privacy. I like how it's designed to boost productivity when multiple agent is involved in editing code, but I think there is a bigger opportunity for it to be a sandbox environment for executing arbitrary agent and tools.

swift sierra
silver abyss
#

I noticed that the allow list in Amazon Q Developer CLI is missing one entry. multiple tools in the docs

container_use___environment_checkpoint
container_use___environment_file_delete
container_use___environment_file_list
container_use___environment_file_read
container_use___environment_file_write
container_use___environment_open
container_use___environment_run_cmd
container_use___environment_update

container_use___environment_config <<< newer

I'll check to see if any others have changed.

#

Looks like there should be 11 tools with 0.3.1 (using Zed to peek)

#

Can also get this directly:

echo '{"jsonrpc":"2.0", "method":"tools/list","id":1}' | container-use stdio | jq -r '.result.tools[] | select(.name | startswith("environment_")) | .name'
#

Ideally we would update these docs with each release of container-use automatically or maybe it can be added to container-use config 🙂

For example for Amazon Q:

echo 'q chat --trust-tools='$(echo '{"jsonrpc":"2.0", "method":"tools/list","id":1}' | container-use stdio | jq -r '[.result.tools[] | select(.name | startswith("environment_")) | "container_use___"+.name] | join(",")')

q chat --trust-tools=container_use___environment_add_service,container_use___environment_checkpoint,container_use___environment_config,container_use___environment_create,container_use___environment_file_delete,container_use___environment_file_list,container_use___environment_file_read,container_use___environment_file_write,container_use___environment_open,container_use___environment_run_cmd,container_use___environment_update_metadata
crimson plume
dawn veldt
#

I can't seem to figure out why I can't cu terminal when using secrets. Filed this GH issue https://github.com/dagger/container-use/issues/232. I took a stab at looking through the source, but don't have enough context on how dagger deals with secrets, etc. That said it's making it hard to use with this broken. Are secrets supposed to be working fully?

restive pumice
restive pumice
dawn veldt
#

Question - It seems cu and probably dagger cache images. So, if I use a custom base image with a latest tag it doesn't seem to update when the image is updated. Is there an easy way to clear/reset this cache? Only solution I found was to delete the dagger engine / volumes.

Also if pulling or checking latest isn't possible what would be the suggested approach? Just use incrementing version numbers? I was thinking of re-using this base image across many repos so ideally they are just up to date with new changes to alias tags.

opaque zephyr
dawn veldt
opaque zephyr
#

For auth, normally dagger will automatically use your local docker credentials. eg. if you docker login, then dagger (and by extension, container-use) will automatically be logged in too

dawn veldt
#

Ok, I don't have the error atm, but will try and reproduce a little later. Good to know this should work as this should make things easier/quicker to test!

#

Thanks!

opaque zephyr
#

If the error is caused by custom certificates, you might need to customize your dagger engine config, I don't remember off the top of my head, but it's definitely possible

#

(Dagger is used heavily by large teams with complicated enterprise stacks, so private registries, custom authentication etc. are very common.)

dawn veldt
opaque zephyr
dawn veldt
#

I kind of figured. Thanks for the project!

opaque zephyr
#

(This discord is also the Dagger team's primary chat server, we don' thave a separate private slack. So we're always around)

restive pumice
honest fog
#

Hi, I'm new to container-use , currently, I got 2 issues.

  1. I cannot cu terminal.
    █ [0.16s] ERROR container-use terminal notable-martin
    ┃ Cannot query field "terminal" on type "Container".

  2. I Cannot connect The address giving from my agent.
    ⎿ Command started in the background in NEW container. Endpoints are {"5000":{"environment_internal":"tcp://19vv1t934f3fo:5000","host_external":"tcp://127.0.0.1:56032"}}

But when I access: 127.0.0.1:56032 its always give me CONNECTION REFUSED. And as I cannot use cu terminal I cannot debug any further.

My environment:
MacOS M1 15.5
container-use version v0.3.1
Orbstack (instead of Docker Desktop)

Does any got into similar problems?

regal veldt
honest fog
regal veldt
placid comet
#

Ah cool, glad ya got it working. FWIW

opaque zephyr
dawn veldt
#

Question - Does each container-use tool call result in a docker run command? If so, I assume this means that using a daemon (e.g. postres, etc.) really isn't practically possible atm?

NOTE: I did see the basic support for dagger services and it kind of works, but wondering specifically about the prior in the shorter term while official support for that is flushed out.

opaque zephyr
#

@dawn veldt are you looking to run the daemon inside the agent's environment, or outside?

dawn veldt
placid comet
#

Has anyone managed to get a uv based Python project to work in container-use?

opaque zephyr
dawn veldt
silent zinc
#

Are there any issues or PRs for interop of other MCP servers with cu? I didn't see anything in the cu repo, but still wrapping my head around cu.

placid comet
potent canopy
restive pumice
restive pumice
# opaque zephyr Someone mentioned container-use in this HN thread, currently on front page 🙂 ht...

https://news.ycombinator.com/item?id=44628409 also comments in this hn thread from people who don't like managing their own git worktrees, responded to this one that reads like a "I wish I had container-use"

zachrip

I tried out git worktrees recently and while they do what's on the tin, I really didn't like them as much as I thought I would. I actually like the way cursor does it despite the fact that it is a VM - I wish I could have their same UI/UX but with local worktrees.

placid comet
# potent canopy oouh, interesting 🙏 Would you mind sharing the details ? 👀

I had to set up a tag for transformers and torch so I could exclude them from uv sync then have a separate uv pip install for each of them, specifying the wheel directly for torch. I also have a bunch of environment variables at the moment that are probably not necessary. I'll ablate at some point but iterating through container after container was quite frustrating (once uv sync hangs, no tool calls work anymore). In devcontainers the tooling uv has for specifying sources works normally.

opaque zephyr
restive pumice
jovial nimbus
frank sundial
potent canopy
#

FYI, I'm almost done reviewing the windows PR / improving it. As part of the review, I'm adding a test pipeline on native Windows (as we're relying on the go sdk on native windows build) + deployment script + pipelines (deployment to Chocolatey + a ps1 install script too (like main dagger), for winget, it's gonna be a tangent PR)

I'm hitting a few bug regarding the registry auth: #maintainers message though, in order to fully test our test suite. But it's more dagger specific thing. However, we need to fix it too as part of this feature 👀

silver abyss
#

Wondering has anyone tried to get container-use to run dagger by maybe having a dind-type container as the base?

restive pumice
pine jasper
#

Hello, I've been trying to use mods with container-use with claude, but so far I encountered:

…
mcp: required argument "base_image" not found
…
mcp: required argument "secrets" not found

in the middle of the session

hallow onyx
#

Hello Everyone, I just learned about container-use and tried to install the mcp server in warp by copying the config from the container-use documentation. However, I can't get it to work. In the MCP Servers section I see Failed to start client. In the logs I see that the initialize message is sent but not answered. Instead, the next thing in the logs is [warn] MCP CLI: server exited. I can run container-use from the command line and it displays the help message. But running container-use stdio exits with an error. Can anybody help?

hallow onyx
hexed warren
#

For the record, this was solved in the thread (docker was not installed, podman was not symlinked to docker)

silent zinc
silver abyss
restive pumice
# silent zinc just some basic tool calls to context7 (via Docker MCP toolkit) and linear for n...

yeah these are the kinds of mcps that "just work" - stateless and interacting with remote resources.

i haven't seen that context7 one before and I frequently manually solve the problem (pasting docs links) that it's trying to solve automatically where my agent can't find the code/docs of my library dependencies. do you find that llms is actually inclined to use it to find lib documentation and it gives good results?

silent zinc
restive pumice
serene dirge
#

There's also a new Qwen Code app (forked from gemini code). I haven't check yet if that can work with container-use.

jovial nimbus
silver abyss
crimson plume
#

Haha yeah even once the smaller ones come out, running multiple agents in parallel against it probably won't be an option

orchid trellis
crimson plume
restive pumice
#

(this is funny to me, but i cannot begin to explain why)

silver abyss
magic crest
shut oriole
#

I followed the getting started docs word-for-word but it looks like the mcp server is failing to load.

#

Is there anything that has changed?

blissful mural
shut oriole
#

Mac M1, latest os
Latest version of CU. I just installed it with homebrew.
I'm trying to get it to work the exact same as in the "getting started".
I just see when I run /MCP when running Claude that the MCP server for CU failed to connect.

Do you have advice on how to get better error messages?

silver abyss
frank sundial
frank sundial
restive pumice
shut oriole
#

Thank you. I got it working. It was something weird with my Docker. @silver abyss @blissful mural

#

🚀 Last Night, Dagger Saved My Agents

fathom topaz
#

Hi Ya'll! I'm new here, been using container-use since I found out about it a few weeks ago. Love the isolation aspect and how easy it is to throw away environments (and the LLM-generated garbage that is contained in it). It's a game-changer for security-conscious agent use.

I find the review workflow to be a bit clunky, so I was wondering if there is someone who can shed some light on it? So I let my agent run and when it is finished, I basically do container-use checkout <env-name> to checkout the state of the environment in my IDE. However, I find I cannot easily switch back to the old state of the env - e.g. git checkout main leaves a branch in my main worktree cu-<env-name>. Is there something similar, like container-use checkout main to use here? Or how are other people reviewing the changes without merging them yet?

jaunty folio
# fathom topaz Hi Ya'll! I'm new here, been using container-use since I found out about it a fe...

I've just begun checking container-use + zed out today so I can't help with what people actually use, but theres quite a good page on workflows here -> https://container-use.com/environment-workflow#quick-assessment-non-interactive

Container Use

Master the workflow of creating, observing, and managing containerized environments. Learn when to merge work, iterate on prompts, or start fresh.

jaunty folio
#

I have to say, this write up of yours on Zed + Container-use has opened up a new world! Big ups @silver abyss

silver abyss
potent canopy
#

Hello i've seen the new bot on the windows PR. What's the status on this ?

crimson plume
restive pumice
restive pumice
#

nix release

silver abyss
silver abyss
#

The fix for my issue opened with Crush is already up! 🙌 Have to test 🙂

GitHub

Fixes MCP clients
This closes #424

Screen.Recording.2025-08-01.at.08.21.43.mov
GitHub

Right now CRUSH will start the MCP stdio server, run the tool, then shut down the MCP server. In my case, the container-use MCP server is allowing me to tunnel to an app running in a containerized ...

restive pumice
#

just released v0.4.1 with some docs changes (notably crush configuration) and some improved locking logic for parallel claude code usage

#

and the nix flake is now updating with our release process, shoutout @night narwhal for the contribution 🙂

placid comet
restive pumice
hallow onyx
silver abyss
#

Curious to hear how people are managing their longer running parallel Claude coding threads. There are a lot about managing parallel terminal session, but I'm looking at managing task completion and review. It seems to evolve towards a visual task manager Kanban board. Drop your suggestions and experiences in the comments. | 23 comments on LinkedIn

hallow onyx
silver abyss
elfin scaffold
#

Hello! Anyone got good prompting tips for optimal use of the MCP? Trying to figure out consistency stuff - like using the same base images that are already in the project. What's been working for y'all?

restive pumice
# elfin scaffold Hello! Anyone got good prompting tips for optimal use of the MCP? Trying to figu...

for the base images and stuff, you can set up an environment config -- this works well so long as you have just 1 image you want to use per-git-repo, but you can also break glass and prompt-engineer stuff like "if you're working on typescript code, use image XYZ instead of the default"

Container Use

Set up and manage your project's environment configurations.

placid comet
#

Is cu terminal container-name supposed to work without a separate dagger install? The only issue I can see suggests that there are problems if you have both installed... but with only container-use installed I get Dagger is not installed. Please install it from https://docs.dagger.io/install/. This has been true in the past 3 versions (0.41, 0.4, 0.3x) for me.

potent canopy
placid comet
restive pumice
placid comet
restive pumice
jaunty barn
#

Is there a way to specify a local image in the base_image environment config?

restive pumice
#

search "local image" in this discord for a bunch of other people with similar problems. generally the workaround is to run a local registry and there are lots of ways to do that depending on your preferred tooling (dagger, docker, k3s, etc)

jaunty barn
#

Gotcha. Sorry, I’m a discord newb

restive pumice
pastel shore
#

Hi, I'm having ssl issue while creating an environment. We use zscaler. I have added the cert using setup step but the tool call fails during base image pull. Wherease in my terminal I can pull the image without any issue. It is available in local registry. How can i resolve this

restive pumice
# pastel shore Hi, I'm having ssl issue while creating an environment. We use zscaler. I have a...

i'm assuming your image is something that's only accessible behind zscaler? does that cert function as a custom CA? there are some docs about how to configure root CAs for dagger , but i don't think anybody's yet tried to point container-use at a custom-provisioned dagger engine . @silver abyss @blissful mural searching discord showed me y'all have some exposure to zscaler in the field?

Dagger can be configured to use custom certificate authorities (CAs) when

A runner is the "backend" of Dagger where containers are actually executed.

silver abyss
#

Once you have a customized0.8.14 Dagger Engine running and working with zscaler, take note of its name via docker ps.

Then set EXPERIMENTAL_DAGGER_RUNNER_HOST": "docker-container://dagger-engine-custom (replace dagger-engine-custom with your engine's name)
as an en environment variable in your MCP config.

Then try to use container-use MCP with your agent. Should use your existing engine with the special certs.

Since you say the image is in a local registry, you should be able to also use:

EXPERIMENTAL_DAGGER_RUNNER_HOST": "docker-image://dagger-engine-custom-zscaler-image:latest
and if the image can be pulled, it will be used for the engine container.

#

Worked for me. That is Amazon Q developer agent

#

Once engine is down, MCP no longer runs since env var still pointing at old name

#

My JSON config. Yours might be similar

{
  "mcpServers": {
    "container-use": {
      "command": "container-use",
      "args": [
        "stdio"
      ],
      "env": {
        "_EXPERIMENTAL_DAGGER_RUNNER_HOST": "docker-container://dagger-engine-custom"
      },
      "timeout": 60000
    }
  }
}
jaunty barn
#

I also run container-use with Zscaler in vs code.

In a terminal, I mount the caCert:

docker run --rm -v /var/lib/dagger -v $PWD/ca-certificates:/usr/Local/share/ca-certificates/ --name dagger-engine-custom --privileged registry.dagger.io/engine:ve.18.12

And the mcp.json


{
   "container-use":{
      "type":"stdio",     "command":"/opt/homebrew/bin/cu",
      "env":{       "_EXPERIMENTAL_DAGGER_CLI_BIN":"/usr/local/bin/dagger",
         "_EXPERIMENTAL DAGGER_ RUNNER_HOST":"docker-container://dagger-engine-custom"
      },
      "args":[
         "stdio"
      ]
   }
}
pastel shore
#

Thanks guys. Ill try this out today

jaunty folio
#

Is there some way that I can debug whats going on with my container-use mcp? sometimes I start getting "server shut down" errors in Zed. Either its the actual MCP extension, or it has to do with container use and I don't really know where to start

restive pumice
covert atlas
#

My team made a YouTube short on container use with goose and a tutorial https://www.youtube.com/shorts/X3tf61_Tak0 https://block.github.io/goose/docs/mcp/container-use-mcp

Get started with Dagger's container-use MCP server: https://container-use.com/

▬▬▬▬▬▬ SOCIALS ▬▬▬▬▬▬

Engineering Blog: https://engineering.block.xyz/blog
Goose Blog: https://block.github.io/goose
Discord: https://discord.gg/block-opensource
GitHub: https://github.com/block/goose
Linkedin: https://www.linkedin.com/com...

▶ Play video

Use Container-Use MCP as a Goose Extension

polar fiber
#

hello, when working with LLMs I always instruct them to make atomic commits using conventional commits convention and to explain on the body what changed, how it was done and why it was done that way (the logic behind the change). Mainly to keep my sanity and have the history as a means of documentation. I've just started using container use and the commits inside the container don't seem to be managed by my coding LLM. Is there a way to configure how to write commits? because the commits written inside the container aren't very useful to me as they are. I've not been able to find any related info on the documentation.

still robin
# polar fiber hello, when working with LLMs I always instruct them to make atomic commits usin...

hey Rafael, the commit message comes from here: https://github.com/dagger/container-use/blob/57d84dea0ef65fbc3e44571e30a23eb485f1ccb6/mcpserver/args.go#L7. Basically, each time the LLM makes a tool call to interact with container use, it summarizes what changes to the tool are required and then uses that as part of the commit message.

GitHub

Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack. - dagger/container-use

restive pumice
# polar fiber hello, when working with LLMs I always instruct them to make atomic commits usin...

I’ve generally found a lot of frustration with trying to get agents to create commits on their own, and that frustration is a big source of inspiration for how container use works- it handles the git in such a way where the agent essentially can’t forget to commit in tiny granular toolcall sized chunks. These commits definitely do not follow best practices or convention, but we found that we could not rely on LLMs to consistently call an explicit commit tool and id rather have weird tiny commits always than conventional commits 1/2 the time

restive pumice
polar fiber
restive pumice
polar fiber
restive pumice
restive pumice
# polar fiber Thanks, I’ll have a look at the code tomorrow

https://github.com/dagger/container-use/issues/100 fyi you're not the only person with gripes about the commit messages lol, but im not sure semantic commits are a good fit either given that the commits are generated per-file-write, not in proper logical blocks like a human would do

GitHub

I noticed that the cu merge has a bunch of commits that don't follow semantic commits. This would definitely help Here are semantic commit message best practices: Format Structure <type>(...

drowsy locust
#

Thanks for the great tool! Can I ask if there's any plan for the workflow described here: https://github.com/dagger/container-use/issues/247 In this case, the claude code isn't aware of the environment and I think claude (or other llms) should be more comfortable with native cli commands.

GitHub

What feature would you like? Would it be possible to add a new command to container-use so I can create an environment by hand, the same way an agent can via the environment_create tool? Why would ...

restive pumice
drowsy locust
#

looking forward to it!! I will be happy to try and test

shut oriole
#

can I attach a volume to the container? I would like to be able to run claude / opencode and be able to attach the cwd but also another directory on my computer where I store prompts and configurations.

polar fiber
#

Has anyone had issues with the container timing out? I'm trying Kiro, and it's working on a container, all looks good except the container starts throwing Error calling MCP tool: MCP error -32001: Request timed out and the LLM tries different approaches, like continuing work outside the container, or simply stopping

restive pumice
restive pumice
#

@polar fiber was this a single agent instance running for a long time? was there anything interesting about the repo it was working on? (large? lots of dependencies to download?) what tool call did it block on?

shut oriole
sinful epoch
#

I'm trying to use this in a private go project. The issue is that it depends on private modules, hosted on github, and the build inside the environment fails. Has anybody managed to get this working? Thanks!

sinful epoch
polar fiber
# restive pumice <@702830920175976529> was this a single agent instance running for a long time? ...

Yes, a single agent instance, python codebase, small repo. I haven't configured an environment.json yet so the LLM is doing all the setup, maybe that's causing the issue? It tends to happen towards the end of the task after about 20 interactions with the container tools. First it blocked on run_cmd then file_list then create. Once the timeout starts it doesn't go away until after a fairly long while. I wonder if there's memory issue with docker or something. It's a M1 Pro MBP with 16gb

restive pumice
restive pumice
# polar fiber Yes, a single agent instance, python codebase, small repo. I haven't configured ...

im gonna keep poking at these hangs at some point this week... the ones i get feel like trouble with the dagger engine, and i found failing healthchecks in docker logs dagger-engine-$version twice. i would recommend bumping your docker/colima/whatever resource allocations if you haven't already to rule that out, the engine getting oomkilled might cause hangs like this. that said, i have VERY large resource allocations (500gb disk, 16gb memory, 8 cores) and i sometimes get a hang (less often than you, it sounds like)

if i had to guess this is some edge case in dagger cache garbage collection, but that's purely speculative based on me running dagger core engine local-cache prune and having it take >25m one time

restive pumice
# restive pumice I think you also need to configure an insteadOf replace directive in git that in...

if you wanna open an issue with all the config injection you've tried, that'd be helpful -- needing the agent to use git and ssh inside the container likely has some rough edges we can polish out. part of this could be related to https://github.com/dagger/container-use/issues/256

GitHub

I have several git configurations, depending on the directory on my machine that I'm working on. However, when I run container-use checkout <id>, the commit author and email address attac...

sinful epoch
sinful epoch
restive pumice
sinful epoch
sinful epoch
restive pumice
sinful epoch
restive pumice
potent canopy
#

Hey @restive pumice,

I finally managed to have the CI on windows green (and stable). I had the weirdest caching / races on Windows: https://github.com/dagger/container-use/pull/252.

I updated the PR description and rewrote the history to be as clear as possible. I'm changing a bit the flock and isolated some of the tests a bit more because I was hitting deep bugs on the gihtub windows runners.

I'm re-deploying / publishing on my fork to be ready for tomorrow, BUT, another pair of eyes might be again necessary, given the changes I made in the end 🙏

zinc sierra
#

Hey! Great tool! One question. I’ve been working for a while and after a bit just about any container-use function (my invocation or Claude’s) takes forever. Even cu list will just hang. If I control C it I get a result (cu list will give me a list after I interrupt it but hang for 5 minutes before).

I’m not sure how to trouble shoot that or where to start.

Also, I notice that when I have commit hooks on, the terminal blows up with every invocation of container use run that gets triggered. Makes the Claude terminal completely unusable. I’m not sure if that chatter lead to the application beginning to hang or not, or if they’re unrelated.

Happy for any thoughts or suggestions…

restive pumice
# zinc sierra Hey! Great tool! One question. I’ve been working for a while and after a bit jus...

One question. I’ve been working for a while and after a bit just about any container-use function (my invocation or Claude’s) takes forever. Even cu list will just hang.

cu list hanging should be fixed by https://github.com/dagger/container-use/commit/2c98c9d57114ebf610b8d601b6ab7c35baa72014 which we'll release soon... but there is definitely still a hang hiding somewhere between container-use and the dagger engine (look above for me and rafa discussing, also posted something in #maintainers yesterday)

GitHub
  • avoid holding locks during Export

Signed-off-by: Connor Braa &lt;connor@dagger.io&gt;

  • worktree rlock during import sync

Signed-off-by: Connor Braa &lt;connor@dagger.io&gt;

*...

restive pumice
# zinc sierra Hey! Great tool! One question. I’ve been working for a while and after a bit jus...

i was thinking about git hooks the other day, too, especially in relation to https://github.com/dagger/container-use/issues/256... i haven't played with them myself, but my assumption prior to your post was that the fact we create a bare repo and push to it would not enable hooks, but from your observation it sounds like pushing hook-enabled stuff to that repo can enable hooks?

unless you have host-system-global git hooks? that's not a thing, right? your git hooks are repo specific, and having them enabled for the repo breaks claude?

hooks definitely deserve a github issue with specifics -- they should be easy enough to fix with --no-verify but i wanna make sure i understand why that's needed

GitHub

Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack. - dagger/container-use

restive pumice
#

container-use v0.4.2 is out!

This is a mostly a patch release, but a feature or two snuck in. Notably:

  1. Improved lock granularity around export -- fixes issues with cu list and other commands hanging while an agent is running a tool.
  2. Added container-use stdio --single-tenant, an experimental mode intended for use with claude code or other CLI based agents. This mode locks each MCP server process to a single environment, reducing the tokens needed for each toolcall and SIGNIFICANTLY improving subtask performance and accuracy. To try this out, add the --single-tenant flag to your agent's MCP server configuration block.
  3. version --system shows versions of our dependencies
  4. Environment creation can now take a git ref, so you can prompt "starting from $branch_or_sha, do task" and expect the agent to no longer be concerned with what you've got in your local checkout

check out the release artifacts here and update with your chosen install method!

GitHub

container-use v0.4.2
This is a mostly a patch release, but a feature or 2 snuck in. Notably:

Improved lock granularity around export -- fixes issues with cu list and other commands hanging while a...

#

cc @zinc sierra v0.4.2 should fix some of the blocking issues you've been seeing. not all of them, but at least the non-dagger-y cli subcommands no longer block.

zinc sierra
# restive pumice i was thinking about git hooks the other day, too, especially in relation to htt...

Sweet! Thanks! Yeah I’ll update tomorrow and see if that helps. What I found was that after it hung, even if I killed Claude, it would stay hung until I rebooted. Not just while processes were firing (that I could see at least)

As to the hooks. I’m not as wise and learned as some. But good test suits are the only way I know how to let an LLM really build and extend an application without breaking it.
But hooks have different levels of where and how they can be implemented.

My perspective: Precommit hooks are ways to help an LLM catch false direction early by realizing it just broke a bunch of things, which probably will help it find a more conforming solution. Downside is I’m forcing conformity at the commit level rather than feature level. So I don’t always ask an LLM to set them up. That said, precommit hooks seem to really cause CU to blow up and hang. If I disable them I can have long coding sessions. If I enable them, it seizes. I’m new enough to CU to not know how to trace why yet.

Pre-push hooks shouldn’t really be a problem for CU since those wouldn’t fire (I don’t think, at least from my understanding of how you’ve built it) until after I merge the environment result and push that to GitHub.

But unless I also have a GitHub MCP to read the results of failed pushes, the LLM that builds the code in the container has limited ability to know what it just broke.

So I’ve mused about creating a wrapper function over ‘cu merge’ that grabs the commit before the merge for future reference, then lets the merge happen, then would run some more involved tests. and if that fails, do a Claude —resume with a custom prompt template that takes the failed test results and has Claude either amend the commit, revert to a previous commit and start over, or do more new commits to patch the issue.

But it might be that using a PR orchestration tool that farms out the implementation stages to ‘cu’ would do what I want by allowing more feature level controls?

zinc sierra
# zinc sierra Sweet! Thanks! Yeah I’ll update tomorrow and see if that helps. What I found was...

With any of these problems, it’s about picking the right point in the abstraction to solve the issue.

Having ‘cu’ be able to handle precommit hooks seems like a pretty good fit. Using it to do logic that’s more commonly associated with pre-push? I’m unsure if that should be something ‘cu’ is right for…. But again, I could encapsulate the pre-push logic inside an environment (a separate one). And if it passed the tests, I could push it to GitHub and know it’ll pass, while having the ability to reroute back to the executor environment to revise the work.

Which essentially is just agentic programming, for which there are many tools. But it seems like the two features I’d need from container use is ability to use precommit hooks well (if I need them) and a “hook” for the “I’m all done” event that I can map to git hooks or some other script/external event. With that I should be able to compose cu tool calling agents together without too much extraneous complexity.

sinful epoch
jaunty folio
#

Whats the recommended way to get a company internal SSL certificate into the container-use loop. Wither by config or "global" (i e it's always there by default)?

jaunty folio
restive pumice
restive pumice
restive pumice
# zinc sierra With any of these problems, it’s about picking the right point in the abstractio...

yeah i'm also very interested in agentic guardrails. talking about abstractions, i don't think that precommits are right for cu guardrails, specifically because at least today, the commit operations actually happen on the host, in ~/.config/container-use/repos/$repo_name. in a world where we can move that stuff inside the dagger engine, then maybe git's own hooks would make sense, but that's a ways off (we'd need dagger to have a way more expressive git-write-and-push API). in the mean time, it prolly wouldn't be too hard to add post_write (precommit) hooks to the env config. this has the added benefit of separate configs for agents and humans. i'd love to have this just for go fmt $path, it's incredibly annoying having to manually prompt "go fmt and fix the linter", or have to do that most-tedious operation myself on the host.

the other interesting thing is by --no-verify-ing the container-use git invocations, you could keep precommit hooks and they'd work ok with cu apply, and verify that the code keeps being valid on your host machine even if it was already determined valid inside the container.

GitHub

An open-source runtime for composable workflows. Great for AI agents and CI/CD. - dagger/dagger

visual garnet
#

Apple container basic setup question. I validated dagger on its own was working with “container” rather than docker. Homebrew install. Then I stopped the dagger container and brew installed container-use but can’t get it working as MCP in Goose and I’m a little stuck on what to check. Do I really need docker directly from cu even if dagger is ok with apple container? Anyone point me how to troubleshoot?

restive pumice
# visual garnet Apple container basic setup question. I validated dagger on its own was working ...

i haven't tested the apple container support, and i suspect it won't work until we upgrade cu's dagger dep to. 18.16 (it's fixed at 18.14 atm) ... for now, you may be able to work around this by starting the dagger engine and then explicitly pointing cu at your 18.16 apple engine using _EXPERIMENTAL_DAGGER_RUNNER_HOST like this:

{
  "mcpServers": {
    "container-use": {
      "command": "container-use",
      "args": [
        "stdio"
      ],
      "env": {
        "_EXPERIMENTAL_DAGGER_RUNNER_HOST": "$however_you_url_the_apply_engine"
      },
      "timeout": 60000
    }
  }
}

(obviously needs to be adjusted for whatever your MCP client/agent is)

#

(fwiw as we speak, i've got a bajillion terminal splits open for stress testing cu with 18.16)

visual garnet
#

That’s super awesome to understand! I think I may pick up another thread and resume once that lands with a brew upgrade

silver abyss
#

yep, the reason being that 0.18.14 relied on shelling out to docker (which could be symlinked to nerdctl, podman, but Apple's container isn't completely CLI-compatible with docker: e.g. docker ps, container ls), but indeed the newer dagger version with drivers for all of those container runtime should make it possible.

zinc sierra
# restive pumice yeah i'm also very interested in agentic guardrails. talking about abstractions,...

Hmm…. The apply method with no-verify sounds like a viable patch.

But how could I make sure any commits the LLM does are passed “—no-verify”? I’m not sure how I’d implement that.

The issue I have is CU can’t handle repos with commit hooks on them. And if that’s true It’s an issue because many repos have commit hooks on them. And since CU leverages git, it’ll have all the same git stuff. In which case I need to find ways to allow a CU workflow to avoid the hooks, find ways to pipe any failures back to Claude to fix (in CU)

Is that a fair assessment?

The finding how to pass no-verify globally to CU environments would allow me to avoid the hooks causing the engine to crash. And at that point I’d just need to design an external method to pipe hook failure messages on the host/GitHub back to Claude. Maybe just have Claude call ‘cu apply && git add . && git commit -a -m … && git reset HEAD~1 && cu merge’
(Or some variant with a bash script) where if the commit on host succeeds and the hooks don’t fail it, then I CAN merge the results, and should do so to preserve the original commit history assuming that’s preferable.

It’s a little tricky because I’ve wanted to enforce that Claude can only use CU. But if I need workflows outside CU I’ll need to broaden those permissions a little.

restive pumice
#

But how could I make sure any commits the LLM does are passed “—no-verify”? I’m not sure how I’d implement that.

the server makes the commits on the host, the LLM doesn't do it directly, committing is a side effect of every other toolcall. if the LLM tries to make its own commits, it will find that it's not actually working in a git repository, just a normal directory full of files.

#

if the LLM is given normal non-cu host shell access, it can use precommit hooks provided that you can

obsidian shell
#

Would container-use enable an agent to drop into a Container terminal?

restive pumice
obsidian shell
#

Have the LLM work in the container terminal where everything is set up, and execute whatever it needs to rather than writing a Function, waiting for its result. To speed things up, basically.

restive pumice
obsidian shell
#

dagger.function, called from the CLI

restive pumice
#

with container-use, the LLM doesn't need to know anything about dagger -- dagger is an implementation detail

#

container-use exposes a bundle of tools to agents via MCP. one of those is environment_run_cmd, which allows the LLM to run shell commands inside of your built-up environment container

frank sundial
#

hi @cunning ferry ! Welcome to the CU channel in the Dagger community.

Thanks for your CU write-up! https://blog.techdecline.dev/container-use-in-dagger-projects/

@restive pumice , engineering lead had a few questions about your use case, so I wanted to kick off the discussion here.

I'll let y'all take it from here 🙂

restive pumice
# frank sundial hi <@636584912840818756> ! Welcome to the CU channel in the Dagger community. ...

i was specifically curious if you hit problems trying to get an agent to use dagger inside of an environment that pushed you towards the TCP dagger engine/DAGGER_RUNNER_HOST approach you detailed in the blog. by default container-use environments run commands with ExperimentalPrivilegedNesting: true, and so they should come with a preconfigured container-internal docker socket that the dagger cli can connect to inside of the container

cunning ferry
#

Hi @restive pumice , I just remember hitting errors that pointed me towards issues with either docker not beeing detected or docker socket issues. Then I tested with some environments where I specified https://hub.docker.com/_/docker as image but couldn't get it to run either (didn't save the errors though). That's when I thought about using the TCP approach. You may want to share an environment.json that I can test on my setup without setting up the TCP socket?

cursive crow
#

Been using claude --dangerously-skip-permissions with container-use which has been awesome (thank you 🙏 ) ... until anything happens to docker on my machine and claude is unable to connect to the cu mcp and instead begins running rough shod over my local.

Any thoughts or patterns for how to mitigate this failure mode? Been experimenting with PreToolUse hook but not sure if that is the right safety system.

opaque zephyr
#

but it's a pretty big change

woven nexus
#

Hi there. What is the best practice for having an agent (claude) test an app/service? i just did a simple test having claude configure an mkdocs site. It tries to use mkdocs serve and it goes haywire. Claude is launching my browser over and over, but the site isn't accessible anyway. I am running claude inside of a github codespace right now. do projects all need to be converted to dagger? a more pressing/real example would be making sure that the playwright mcp works with container-use. i haven't tried it yet, but after seeing what happens with just verifying that the mkdocs site launched, i'm concerned that will be a challenge.

restive pumice
restive pumice
# woven nexus Hi there. What is the best practice for having an agent (claude) test an app/ser...

What is the best practice for having an agent (claude) test an app/service?

install your test dependencies via environment configuration and include instructions in your CLAUDE.md to help claude know what to run (example that's used to have agents test container-use itself)

do projects all need to be converted to dagger?

converting to dagger is orthogonal to container-use, so I definitely wouldn't start there. using dagger within container-use can be super helpful for some things, like in container-use itself i only run the linter inside dagger so it's guaranteed to be consistent with our dagger-centric CI. using dagger within container-use is also crazy powerful for a lot of infra/release engineering tasks, but that's not what you're trying to do.

a more pressing/real example would be making sure that the playwright mcp

by "test" then, do you mean browser test? truthfully i don't build webapps, but theoretically the environment run_cmd tool with the "background" option should enable the agent to start a service. networking info will be returned to the agent that includes a host_external address that's accessible on the host machine. you should be able to point the playwright mcp at that. i'd coax the agent into doing that one time, and then write up instructions on how to do it consistently into CLAUDE.md

woven nexus
#

i'm going to do a similar test on my mac and compare behavior. then maybe i can provide some better detail as to what i'm seeing in codespace. thanks for the moment.

restive pumice
woven nexus
#

on my mac it worked well:

Command started in the background in NEW container. Endpoints are {"8080":{"environment_internal":"tcp://k1pk4fp2nlct6:8080","host_external":"tcp://127.0.0.1:51184"}}

Perfect! I've created a simple HTML page and it's now being served.

Your page is live at: http://127.0.0.1:51184

#

will retest in codespace sample simple prompt

woven nexus
#

on codespace the run_cmd times out:
● container-use - environment_run_cmd (MCP)(environment_source: "/workspaces/plugin-shared-kernel", environment_id: "brief-hare", command: "mkdocs serve --dev-addr
0.0.0.0:8000", background: true, ports: [8000], explanation: "Starting MkDocs development server on port 8000 for site preview")
⎿ Error: failed to run command: service failed to start within 30s timeout

#

part of figuring out container-use/dagger/depot etc is to move away form codespaces 🙂 so i'm not going to dig on this

#

that being said the replacement usecase might be depot claude or factory.io.

restive pumice
#

tbh that seems crazy, though, like it's a dev environment, it's gotta let you start services open high numbered ports there normally

#

but the dagger engine does need a lot of permissions, so idk

woven nexus
#

yeah. there's an official microsoft docker-in-docker. it's worked great compared to old days having to manually set it up. we have run all kinds of docker compose and minikube without issue

#

so if i were to look, it would be a dagger ENV for the docker socket maybe?

restive pumice
woven nexus
#

that's ok. thanks for the help

cunning ferry
restive pumice
#

im also not 100% on exactly how dagger's nesting works, like it may be exposing the docker socket in the environment.

cunning ferry
#

a faq is always useful in retrospect when feeling silly after solving an issue that hasn't been there eventually in the first place 😄

restive pumice
#

so the env has access to dagger, but not to docker

#

implicitly, i think that means what you did does still have value in that you could use that technique to give the env docker development capabilities if you installed docker, compose, etc in the env

#
3. **Environment Variables Injection**
The system injects special environment variables into the executing container:

- `DAGGER_SESSION_PORT` - The port where the nested client can connect
- `DAGGER_SESSION_TOKEN` - Authentication token for the nested session  
- `_DAGGER_NESTED_CLIENT_ID` - Unique identifier for this nested client
- `_DAGGER_SESSION_ID` - The parent session ID
cunning ferry
restive pumice
#

like i wrote this and use it all the time and im still over here asking claude to explain how the dagger end of it works XD

#

this is one of those things, like ye olde docker-in-docker, that was originally built to facilitate the development of the thing itself, but just like docker-in-docker, it turns out this dev-facing feature has user-facing applications too 😅

cunning ferry
#

or, the distinction between user and dev is not exactly sharp in the age of AI

placid comet
# cosmic birch using a private registry should work out of the box (assuming `docker pull` work...

...and if it doesn't? I've tried setting up manifests for docker or OCI, docker login and many other variations but consistently get connection refused when it tries to get the manifest, although it works fine from the commandline and curl can retrieve the manifests without any problem, even from another container sitting next to dagger. I need to run a local registry because I have large dependencies (torch et al) and cu frequently falls apart when it takes a while to set up the container.

potent canopy
placid comet
# potent canopy Hi 👋 , can you please try directly with just dagger: `docker login ...` then `d...

Thanks for your suggestion @potent canopy I'm a CU user, not really familiar with using dagger so thanks for your patience. This is what I get...

dagger -c 'container | from registry.local:5001/libby-base:dev | terminal'
▶ connect 27.5s
▶ detect module: . 0.3s
● loading type definitions 0.3s
✘ terminal 0.0s ERROR
! failed to resolve image "registry.local:5001/libby-base:dev" (platform: "linux/amd64"): failed to resolve source
  metadata for registry.local:5001/libby-base:dev: failed to do request: Head "https://registry.local:5001/v2/libby-
  base/manifests/dev": dial tcp 10.2.1.150:5001: connect: connection refused

● container: Container! 0.0s
▼ .from(address: "registry.local:5001/libby-base:dev"): Container! 0.0s ERROR
! failed to resolve image "registry.local:5001/libby-base:dev" (platform: "linux/amd64"): failed to resolve source
  metadata for registry.local:5001/libby-base:dev: failed to do request: Head "https://registry.local:5001/v2/libby-
  base/manifests/dev": dial tcp 10.2.1.150:5001: connect: connection refused
╰─▼ resolving registry.local:5001/libby-base:dev 0.0s ERROR
  ! failed to do request: Head "https://registry.local:5001/v2/libby-base/manifests/dev": dial tcp 10.2.1.150:5001:
    connect: connection refused
  ╰─▼ remotes.docker.resolver.HTTPRequest 0.0s ERROR
    ! dial tcp 10.2.1.150:5001: connect: connection refused
    ╰─✘ HTTP HEAD 0.0s ERROR
      ! dial tcp 10.2.1.150:5001: connect: connection refused
# curl works tho:
curl https://registry.local:5001/v2/libby-base/manifests/dev
{
   "schemaVersion": 1,
   "name": "libby-base",
...
potent canopy
#

debug connection

glacial fulcrum
#

👋 I'm using container-use with amazon q. I've had a recurring issue where the tool starts timing out (60s). It doesn't always resolve itself. If I connect to the cu terminal, I see that there is a 502 error. I've had to restart my system (mac os) to get the container into a clean state - restarting Docker does not work. Any advice on what might be happening and how I could resolve it?

➜ cu version
container-use version 0.4.2
commit: 89ebe7765ec067a07c51de104822056eb217c1b9
built: 2025-08-19T22:23:38Z

➜ dagger version
dagger v0.18.17 (image://registry.dagger.io/engine:v0.18.17) darwin/arm64/v8

➜ brew info docker
==> docker: stable 28.4.0 (bottled), HEAD

➜ brew info docker-desktop
==> docker-desktop: 4.45.0,203075 (auto_updates)
glacial fulcrum
#

container-use timeout with Amazon Q

pastel shore
opaque zephyr
potent canopy
#

Do you have any example for this yet ?

ocean wave
#

so container use integration with code terminal tools is "just" an mcp endpoint as of now, correct?

potent canopy
polar fiber
#

hi, I'd really appreciate it if you could help here. Claude Code is getting these errors when trying to create a new container.

     source directory: failed to get content hash: failed to get 
     snapshot: failed to sync: failed to create new copy ref: failed
      to prepare  as vcbdthy9ykwwdfhcz2ww109v9: failed to create 
     temp dir: mkdir 
     /var/lib/dagger/worker/snapshots/snapshots/new-1183942730: no 
     space left on device```
and
``` Error: failed to update repository: load: load: load base: load
      base: load base: load base: load base: load base: load base: 
     load base: load base: load base: load base: load base: load 
     base: load base: load base: load base: load base: load base: 
     load base: load base: load base: load base: load base: load 
     base: load base: load base: load base: load base: load base: 
     load base: load base: load base: load base: load base: load 
     base: load base: load base: load base: load base: load 
     host.directory(path: "/path/to/repo", noCache: 
     true).asGit.ref(name: 
     "8bab2c7b0fa8e7d7f16bf0f46419b983376cbc34").tree(discardGitDir:
      true): Directory!: load: load base: load base: load base: 
     failed to get content hash: failed to get snapshot: failed to 
     sync: failed to create new copy ref: failed to prepare  as 
     hzs4p701r7jo4qlnlp3zwq8j1: failed to create temp dir: mkdir 
     /var/lib/dagger/worker/snapshots/snapshots/new-3570372337: no 
     space left on device```
My mac has 435GB of free space, so I'm not sure what the error is about.
Thanks
potent canopy
#

hi, I'd really appreciate it if you

woeful comet
#

Hello I try to (step 1 ) build an image and export it (step2) load the container image

step1 => container | from postgres:latest | export-image myimage
step2 => container | from myimage

but i keep getting this kins of error

! failed to resolve image "docker.io/library/myimage:latest" (platform: "linux/amd64"): failed to resolve source metadata for docker.io/library/myimage:latest: pull access denied,
repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Can you help ?
Thanks

opaque zephyr
woeful comet
opaque zephyr
woeful comet
#

What you say is true. I am trying to explain step by step how to use the tool. step1 : create an image, step2 : start a service from the given image

crimson plume
cursive crow
#

Codex cli isn't using container-use mcp.

I feel like I'm missing something in the setup of codex cli. I have added the mcp config (https://container-use.com/agent-integrations#openai-codex) but when I run codex its not creating or using a container-use environment.

Do I need to create agent instructions similar to for the claude code installation? (https://container-use.com/agent-integrations#claude-code)

Do I need to guide the agent to use the mcp?

Container Use

Setup guides for some popular coding agents.

opaque zephyr
cursive crow
potent canopy
potent canopy
stable marsh
#

Hi, I find that for what I'm doing (working in claude code, manually confirming every step), container-use is useful.
Is anybody still using container-use?

However, I want to harden the container-use base-image to run podman-in-docker,
and it looks that I need to pass some "docker run" type of flags, so container-use uses them to start the container
Is there a workaround for this? https://github.com/dagger/container-use/issues/319

opaque zephyr
stable marsh
# opaque zephyr Hello! For more fine-grained control you might need to call Dagger directly (it'...

Can you provide some hints how calling dagger instead of container-use would work in the case of claude code mcp server?
Currently I'm building the image, and pushing it to a private registry, I don't need to do anything more
container-use config base-image set docker.io/username/image-privileged:latest

Do you have any notes or examples of achieving this with dagger?
Would switching to dagger solve also my other issue, which is about using locally built images? https://github.com/dagger/container-use/issues/311
Apart from these two issues (1. privileged container, 2. locally built image) , and https://github.com/dagger/container-use/issues/304, container-use is feature complete for me, I only need a bit better security in terms of container isolation.

cursive crow
#

Been fully embracing CU, its great.

# .zshrc - yolo is my middle name
alias g="gemini --yolo"
alias c="claude --dangerously-skip-permissions"
alias codexxx="codex --dangerously-bypass-approvals-and-sandbox"

Some times the docker daemon is flaky (think docker desktop updates) then I have a loose cannon smashing around my terminal. Suggestions/best practices for having more safety around forcing sandbox usage?

opaque zephyr
cursive crow
stable marsh
# opaque zephyr cc <@108011715077091328> <@135620352201064448> are we ready to bridge this UX ga...

For my use-case I'm interested in:

  1. having a possibility to start a container with container-use (or dagger) with --privileged (or other security related options, like -device /dev/fuse) https://github.com/dagger/container-use/issues/319
  2. Having a possibility to make a locally built image (currently I use devcontainer-cli to build the image, but other ways of building images may be needed, so not limited to dagger) importable into dagger, so container-use (or dagger) can start it, without the need to push/pull from cloud registries https://github.com/dagger/container-use/issues/311. If dagger can use the devcontainer-cli API somehow to build the image, that would also solve my problem.
opaque zephyr
#

Alternatively, you could use Dagger to run the agent itself inside a container, removing the need for mcp altogether. One benefit of this approach is that the agent no longer has the option to escape the sandbox. So you don't need to prompt it to do so in AGENTS.md or whatever. It literally has no other choice.

opaque zephyr
#

The issue is not Dagger's capabilities, but finding a good way to integrate it into your workflow without too much work for you

stable marsh
# opaque zephyr Dagger has a complete container runtime and build API, it doesn't need to call o...

devcontainer-cli supports devcontainer.json. I'm not sure dagger/container-use can replace it https://github.com/dagger/container-use/issues/279
I'm building the image like this, and my goal is to have the podman-in-docker image usable from both container-use/dagger and vscode/devcontainer-cli

export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
./node_modules/.bin/devcontainer build --image-name docker.io/username/image-privileged:latest --workspace-folder .
cursive crow
#

I'm getting volume out of space errors. Seems that container-use has filled 90% of the disk space I've allocated to docker desktop with snapshots in its volume: worker/snapshots/snapshots/${numbered_counter}

How do I prune those snapshots w/o breaking cu? (maybe this is a simple docker question but couldn't find any cli options or reference in the docs)

unkempt tinsel
#

hello, haven't seen any new versions of container-use released though a couple of prs looked approved and not merged . What is the release cadence if any for container-use ?

opaque zephyr
opaque zephyr
unkempt tinsel
vernal elk
#

Any good resources to getting started with containers?

potent canopy
bold rock
#

I'm constantly getting session timeout errors with container-use when using claude code. Anybody else?

bold rock
#

Now my dagger container is crashing and says it cannot restart...very unreliable

opaque zephyr
#

Sorry about that @bold rock. It definitely has rough edges.. I think this issue was reported before? @potent canopy does that ring a bell?

potent canopy
cursive jetty
#

hi friends! can someone please help me with my workflow with container-use; every time I try to instruct the agent to push upstream and create a PR, my local git checkout changes

I guess problem I am facing is that two agents running concurrently suddenly switch to modifying my single checkout together; is there something I am missing 🤔

potent canopy
cursive jetty
# potent canopy Hi, thanks for the ping, do you have a standalone repro that I could try locally...

like a repo or something, or? I can try and see to package something up!

I wonder what I'm doing wrong, though; now that I had some time to think about it, I believe the model realizes I'm asking it to push a branch, but that Git isn't available, so it immediately drops back to my host and performs a checkout; but I've tried explaining now, among my other instructions whilst opening a PR, to resolve the container-use branch and use Git to open a PR upstream without checking out from the environment, and the model is 2/3 times still very eager to ignore my requests and checks out code locally 😓

potent canopy
shadow wadi
#

Is there a reason why container-use cant be used for simple dev containers, not agents?

potent canopy
shadow wadi
potent canopy
shadow wadi
#

I just want to use it as an isolation mechanism.

#

Like Incus, just leaner

potent canopy
#

mmh, I think once https://github.com/dagger/dagger/pull/11332 is taken over and resumed, you should be able to. Until we have a nice DX for container <-> host interaction it's a bit complicated, doable (we do run test in isolation in Dagger atm)

sharp abyss
#

flake

pliant aurora
#

Hi,

I’m not sure if this is the right forum, but I’ll ask anyway.

Has anyone here used Dagger to manage Proxmox services? And would it be a good match?
I read about Dagger for the first time yesterday and I like the idea of infrastructure as code.

slate tundra
#

hi,
I want to give a try to container-use (using devenv.sh to setup binaries) but I go a weird issue... when container-use stdio is trigger, my fresh dagger container is killed and restart with an older version 🤔 why ? sorry for this question but is the project still maintained?

❯ cat devenv.nix
{ pkgs, lib, config, inputs, ... }:
let
  pkgs-dagger = import inputs.pkgs-dagger { inherit pkgs; };
in
{
  packages = [
    pkgs-dagger.container-use
    pkgs-dagger.dagger
  ];
}
❯ cat devenv.yaml
inputs:
    nixpkgs:
        # ...
    pkgs-dagger:
        url: github:dagger/nix
❯ devenv shell

❯ dagger version
dagger v0.19.9 (image://registry.dagger.io/engine:v0.19.9) linux/amd64
❯ docker ps | grep -oh "dagger-engine.*"
dagger-engine-v0.19.9

❯ container-use stdio &
[1] 305899
❯ docker ps | grep -oh "dagger-engine.*"
dagger-engine-v0.18.14

❯ container-use version
container-use version 0.4.2
commit: 89ebe7765ec067a07c51de104822056eb217c1b9
built: 2025-08-19T22:23:38Z
#

or should I go full dagger to do mostly the same ?

opaque zephyr
# slate tundra or should I go full dagger to do mostly the same ?

It's not officially abandoned, but it's true we haven't been actively developing it. Yes it seems there is much more interest in using full Dagger directly. For more simple sandboxing, it seems that coding agent tools bundle enough features to give you the basics.

#

As for your immediate problem: I think you can avoid the "kill other dagger engine" behavior by setting the env var DAGGER_LEAVE_OLD_ENGINE=1

shut oriole
#

Does anyone use dagger with opencode?

#

Looking for example integrations or flows

#

Something inspiring

raven notch
fair river
pearl ridge
#

Hi! I want to use container-use as fully as possible with Claude Code. I'm thinking about if I should disallow some tools in Claude Code to force it to use container-use. Following the quickstart guide, it looks like the recommendation is to allow the default set of Claude tools along with all the container-use tools.

What I wonder specifically is if the planning phase (including research with WebSearch) should happen in container-use or outside. What I can gather (e.g. here) the idea is to do planning in Claude Code and let it shift to container-use only for the actual implementation – writing and running code basically. Is this correct?

plain comet
surreal saffron
opaque zephyr
surreal saffron
magic crest
#

No merges since 2025 🙁

plain comet
#

I'm using both dagger and container-use via devbox with https://github.com/dagger/nix
My setup uses OpenCode integration https://container-use.com/agent-integrations#opencode
I experience weird quirk, when i apply and delete env using container-use cli, then agent in open code can't create a new env. When I close and re-open opencode then from the same session it can create new env without any problem. I also start opencode in devbox shell that has both dagger and container-use. I have no idea which part of this setup is causing this glitch.

GitHub

Contribute to dagger/nix development by creating an account on GitHub.

Container Use

Setup guides for some popular coding agents.

opaque zephyr
# magic crest No merges since 2025 🙁

Sorry about that. Yes at the moment we're not actively developing new features on container-use. We've been focusing on improving the underlying Dagger engine (which indirectly benefits container-use).

If anyone wants to invest time in maintenance, we are open to sharing maintainer privileges (after a quick sanity check to make sure you're not attempting a supply chain attack 🙂

magic crest
#

I'd be honored to be considered for that. Kyle, Lev, and Jeremy have met me before and Jeremy knows where I work at.

opaque zephyr
#

@magic crest what do you have in mind for the project? Specific features you want to add, or just KTLO?

opaque zephyr
#

@magic crest sent you an invite with maintainer access on the repo

magic crest
#

Omg wow. Awesome. I was analyzing the branches earlier and I liked the idea of reviewing the test-suite for inclusion into the next release along with other merges to main.

#

And from there all the low risk, small changes branches including docs, coding assistant changes, and git handling improvements.

frosty bison
#

Hello

I am using container-use to vibecode on my dagger modules
That means that the agent needs to run some dagger commands inside the container-use Environment
I installed docker and dagger as setup-command of my container-use
But I need a way to start dockerd when we are starting the Environment
Do we have a way to override entrypoint ?

frosty bison
#

Is there a way to run a container-use Environment as privileged (aka docker run --privileged ...) ? I will need it to run docker-in-docker

uneven sonnet
#

Hey there! N00b.
I have installed everything and everything is feeling ropey.

  • I installed container use with brew ... and have been getting some ok results.
  • so i installed dagger with brew as rereading docs,
    And container-use fails now because brew installed dagger:0.20 as a docker image and I think 0.18 is expected - is this correct? should I uninstall dagger if iam using container-use!?
#

I uninstalled dagger ... obvs now i get

cu terminal some-env

   ERROR 

  Dagger is not installed. Please install it from
  https://docs.dagger.io/install/.

but how do i install it so it doesnt break with container-use?

#
  • Dagger image is running in Docker
  • I installed with brew install dagger/tap/container-use ... whats gwan?
uneven sonnet
#

Ok - i force installed the 0.18.14 version, and it is happy again.

#

However, I am trying to use it with MCP and ZED.
✅ I have installed container-use-mcp extension
❌ I followed conatiner use docs for Zed, and added the following - which times out (see img)

"context_servers": {
    "container-use": {
      "command": "container use",
      "args": ["stdio"],
      "env": {},
    },
#

This works ... but im going blind here

"context_servers": {
    "container-use": {
      "command": "cu",
      "args": ["stdio"],
      "env": {},
    },
magic crest
weary isle
#

hi everyone! yesterday i started testing container-use for my nix flake + devShells workflow, but hit the problem with timeouts

i configured cu to use nixos/nix as a base image, i tell my agent to start the app and give me a link, it creates environment, tries to start something like "nix develop -c just" (just is just a task runner kinda like make), but then after 30s it failed to run service

https://github.com/dagger/container-use/pull/127/changes
this is pr that introduced serviceStartTimeout which is 30s and it is not configurable, is it possible to change this behaviour?

i'm happy to make a contribution, but need some opinion first

#

i stumbled upon cu trying to find sandboxed shell solutions, and now i am testing this: i disabled all editing and terminal built-in agent tools and enabled all the cu tools, is that a valid approach or cu is better fit background agent work?

candid raft
#

Is there a way to use custom images for container-use? So the agent doesnt waste time installing tools like bun, ...?

dull wedge
frosty bison
#

Hello

I have created a custom runner that is running dagger-engine 0.20.5 and is exposed through TCP on port 8678
I have defined _EXPERIMENTAL_DAGGER_RUNNER_HOST as tcp://127.0.0.1:8678
When running dagger, everything works fine. It detects the engine and connect to it.

When using container-use, AI agent (I tried with Claude Code/OpenCode/Zed) reports container-use does not work because it expect dagger-engine-0.18.4

Is it expected ?

#

If I force my custom runner to use dagger-engine 0.18.4 and force local dagger CLI to use 0.18.4, it works fine

main inlet
#

@still robin @opaque zephyr container-use going to be deprecated or will be merged into dagger only?

opaque zephyr