features
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?
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?
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 ?