Documentation
¶
Overview ¶
Package sorter topologically orders containers by their declared depends-on and links graph so updates happen in a safe order.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortByDependencies ¶
func SortByDependencies(containers []types.Container, includeComposeDepends bool) ([]types.Container, error)
SortByDependencies will sort the list of containers taking into account any links between containers. Container with no outgoing links will be sorted to the front of the list while containers with links will be sorted after all of their dependencies. This sort order ensures that linked containers can be started in the correct order.
When includeComposeDepends is true, Watchtower also augments the graph with edges derived from Docker Compose's com.docker.compose.depends_on labels — service names resolved to container names within the same Compose project. Opt-in because it changes the order (and therefore stop/start behaviour) for Compose-managed stacks that currently rely on watchtower only seeing the explicit com.centurylinklabs.watchtower.depends-on label.