#How can we spin up dev container from dagger? Please help to write a step by step blog

1 messages · Page 1 of 1 (latest)

crude vortex
#

I am currently exploring to write a step by step guide blog to spin up dev containers with dagger only.
in this workflow, we dont want to write any docker file or docker compose file also.
Awating your response.

patent hamlet
#

you can spin up devcontainers with Dagger. There's a caveat though which is that Dagger doesn't allow yet to bind mount files in your machine to the container

#

so you'll have to restart the devcontainer each time yoi make changes to your files

#

it's not the ideal flow, but something that we'll eventually want to enable

crude vortex
#

any ETA?

crude vortex
#

@patent hamlet any ETA bro?

patent hamlet
#

Hey! There's no ETA for this.

crude vortex
#

@patent hamlet is this possible now with dagger 0.10 release?

patent hamlet
#

hey! no, not possible yet. You can still do it, but it has the same caveats that I mentioned above

#

the code that you modify in the devcontainer won't be automatically synced to your local machine

crude vortex
radiant sage
#

@crude vortex - It might not be exactly what you are looking for, but I figured I'd throw it in here as a possibility. We are using Coder successfully for a while now for what they call CDEs or cloud development environments. Maybe it is what you are looking for?

crude vortex
crude vortex
patent hamlet
patent hamlet
#

also, what do you expect this dev environments to contain?

#

are you planning to provide a remote VSCode or something so developers can edit the code in the editor?

#

what's the workflow that you have in your mind?

crude vortex
# patent hamlet are you planning to provide a remote VSCode or something so developers can edit ...

we just want to spin up dev container through the dagger and want to develop in that container and once work done we want to stop or kill that container, currently in local machine...other part we will take later in enhancement and basically we want to replace docker in our devops workflow with dagger for any end to end work...we dont want to write docker files or compose yml files, that's it
Please HELP

lone hare
#

@patent hamlet one part I'm not sure about, is IDE integration. What's the standard way for IDE to integrate with a devcontainer? Can I configure say, VSCode or Zed so that it's transparently editing files in the contaner, and when it opens a terminal, that terminal is in the container? That's the experience I would want, but I have a feeling that reality is not so seamless...

patent hamlet
lone hare
patent hamlet
lone hare
#

Ah well that answers my question, it' s a vscode-specific server protocol

#

One part that will be painful, is that VSCode remote works by airdropping binaries into the remote server in a very ugly way

#

I expect it doesn't work well with ultra-ephemeral containers, because VSCode will just reinstall everything each time, which will be slow

patent hamlet
#

it's quite nice because it also multiplexes other ports over the same transport. So if you run something in your dagger container, you can still access it via localhost in your machine

patent hamlet
lone hare
patent hamlet
lone hare
#

Yes but it's also a specific implementation in a VSCode extension, which has a hardcoded dependency on the docker CLI I think

patent hamlet
#

I'd assume there's something in the spec where you can say: "don't provision the server, just connect to this port".. but we'll need to check

lone hare
#

Eventually would it make sense to fork the devcontainers extension, and make a Dagger-compatible one? Or even contribute dagger support to the upstream extension?

#

Not looking good 👆 (for preinstall)

But cache volume could work

#

@patent hamlet I think the options for integrating with VSCode boil down to 3 possible entrypoints:

  1. SSH (via Remote/SSH extension)
  2. Docker CLI (via Devcontainers extension)
  3. Dagger CLI (requires forking the devcontainers extension)
radiant sage
crude vortex
#

@lone hare @patent hamlet first of all thank you so much for taking consideration of this idea and showing serious efforts in this direction, yes after spinning up container we can connect it with vs code via vs code remote container or ssh feature of vs code extensions, so we are very close...we don't require to much things to implement to achieve this...please keep this efforts on and help me to write a blog for dagger.
which can remove the dependency of docker eventually.

crude vortex
#

any update for this vision?

crude vortex
#

@lone hare any steps required from my side?

#

can running cli command forwarded to dagger and then to cli to get that running url and get auth with it?

crude vortex
#

@lone hare @patent hamlet are we there yet?

#

@lone hare can we achieve similar functionality of https://devpod.sh/ with dagger function capabilities without using devpod?

DevPod is infrastructure-independent and client-only, which makes it incredibly easy to get started with. Codespaces but open-source, client-only and unopinionated. Works with any infra, any progamming language, any IDE, etc.

lone hare
#

@crude vortex no, Dagger does not replace devpod. It's possible to implement a devpod equivalent on top of Dagger primitives, as discussed in this post. But that is not something we (the core Dagger developers) are focused on. If you decide to work on this yourself, we will be happy to support you by answering your questions. But unless you or someone else in the community decides to invest their own time, it will not happen on its own. Please stop asking.