features icon indicating copy to clipboard operation
features copied to clipboard

How can I bring down services managed by Docker-in-Docker/Docker-outside-of-Docker features when I shut down a dev container?

Open m-roberts opened this issue 2 years ago • 1 comments

Currently the spec only supports bringing down Docker services that are explicitly provided to runServices in docker compose implementations. When using the Docker-in-Docker feature with pre-builds, these services appear to be left "up" inside the volume and conflict with each other.

This could be worked around if there was the ability to provide a custom shutdown action (equivalent to running docker compose down in the container).

I also accept that I may not be thinking about this correctly - is there a way to do this, or is this something to consider adding to the spec?

m-roberts avatar May 02 '23 19:05 m-roberts

I think what you may be asking for is a lifecycle hook when stopping the dev container - maybe similar to https://github.com/devcontainers/spec/issues/229 ?

joshspicer avatar Jun 21 '23 18:06 joshspicer