-
Notifications
You must be signed in to change notification settings - Fork 283
On-demand starting containers, and automatic stopping of idle containers. #899
Description
Tell us about your request
I'd like the ability to "scale containers to zero".
I'd like containers to automatically be stopped after an idle period.
I'd like containers to be started on-demand, when (any of) their exposed ports are accessed.
Which service(s) is this request for?
docker engine (afaict)
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
As a developer, I currently run a litany of services, each requiring their own dedicated memory and cpu. Some of these services are run infrequently, but still consume their reserved resources.
I'd like to free up these resources when not in use, so that other services can run smoothly (including my host operating system).
I'd like to not have to start and stop services myself.
Are you currently working around the issue?
Yes, I've vibe coded my own docker TCP proxy as a workaround. It works remarkably well (IMO), but requires additional configuration (labels) on the child containers:
- https://github.com/mountain-pass/lazy-tcp-proxy
- https://hub.docker.com/repository/docker/mountainpass/lazy-tcp-proxy/
Additional context
Currently I'm proposing this for standalone containers - but this would work well with docker swarm stacks as well.