coder / envbuilder

Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.
Apache License 2.0
144 stars 26 forks source link

Investigate feasibility of `docker-compose` support #135

Closed dannykopping closed 4 months ago

dannykopping commented 5 months ago

https://containers.dev/implementors/json_reference/#compose-specific

This may not make it into the 1.0 release if we find that it doesn't fit the envbuilder model or requires lots of refactoring.

shiipou commented 5 months ago

Oh cool to see that issue, that can totally upgrade my experience to use it.

I hope my usecase can help :

I have created a kubernetes template in coder v2 that use envbuilder and provide a DinD (Docker in Docker) sidecar. That allow me to create my container using the .devcontainer specifications and I can start a database aside to use it in the workspace project.

Using the dockerComposeFile can allow to use the DinD sidecar to start the workspace.

Maybe that can be something like this for the implementation.

johnstcn commented 4 months ago

A compose-file is not just a single container, but contains many of the following:

Envbuilder currently relies on GoogleContainerTools/kaniko to build images, and kaniko has no plans to support compose.

In order to support compose, we would, at a minimum, need to either:

a) Switch to a different backend that supports the compose spec, or b) Implement the compose spec ourselves and build any required images on demand

The tricky thing here is that kaniko in its current incarnation only supports building one image at a time, so we would need to separate the 'build' process from the 'run' process.

bpmct commented 4 months ago

Yeah, let's consider this out of scope for the v1.0 release and pick it back up depending on feedback

mafredri commented 4 months ago

Should we close this @bpmct if the investigation is complete?

bpmct commented 4 months ago

Sure :)