buildx
buildx copied to clipboard
docker-container: restart-policy opt
Currently we can't set the restart policy for buildkit containers created with docker-container
driver. In my use case I have restarted some machines but as the default restart policy is no
, the containers were not running. Even if we ensure nodes are booted before building I think it's still useful to have this driver opt.
I keep the current default behavior but I think we could set always
by default. WDYT?
Signed-off-by: CrazyMax [email protected]
LGTM.
Personally, not sure about defaulting to always
, I quite like the default lazy behavior with restart-policy=no
, since I can sometimes have a lot of builders, which might not all actually be running. But, also, this would then match the kubernetes driver behavior, where the replicas are always running. If we do switch the default, we should default to unless-stopped
I think, since buildx stop
will stop the container, which then shouldn't automatically restart.
If we do switch the default, we should default to
unless-stopped
I think, sincebuildx stop
will stop the container, which then shouldn't automatically restart.
Good point for unless-stopped
, tbf I never used buildx stop
and didn't recall it ever exists :sweat_smile:
PTAL @tonistiigi
Needs rebase
What is the use case for this? In what case would the user need to change this? Running a builder takes resources and memory so if it is not being used it is better if it is not running.
What is the use case for this? In what case would the user need to change this? Running a builder takes resources and memory so if it is not being used it is better if it is not running.
@tonistiigi Main use case is for the Build UI in Docker Desktop so I can see my build history without needing to start my builders.