Merge pull request #50327 from Adrien-Atmosphere/50326-wait-for-dependent-containers

Wait for container dependencies upon daemon start up
This commit is contained in:
Rob Murray
2025-07-17 20:24:34 +01:00
committed by GitHub
2 changed files with 32 additions and 2 deletions

View File

@@ -575,8 +575,8 @@ func (daemon *Daemon) restore(cfg *configStore) error {
logger.Debug("starting container")
// ignore errors here as this is a best effort to wait for children
// (legacy links) to be running before we try to start the container
if children := daemon.linkIndex.children(c); len(children) > 0 {
// (legacy links or container network) to be running before we try to start the container
if children := daemon.GetDependentContainers(c); len(children) > 0 {
timeout := time.NewTimer(5 * time.Second)
defer timeout.Stop()