Skip to content

Quadlet support depending on health conditions for container #18189

Closed
@Lunarequest

Description

@Lunarequest

Feature request description

Docker compose has a detective depends_on which can be used to depend on containers in a compose stack and wait to start containers that use this until the health check passes, if they don't the service is not started. An example would be

depends_on:
      db:
        condition: service_healthy

Any container in the compose file with this directive will not start until a container named db starts and has a healthy condition, this is useful for things like postgres which take a bit to start up at which point other services that depend on it may fali as postgres hasn't started up.

Suggest potential solution

I would like a directive under [Container] that mirrors the depends_on field maybe

[Container]
DependsOn=name.container@healthy

where @healthy refers to the condition

Have you considered any alternatives?

I have considered add bash to my container and writing a shell script to wait for the db to come up but I would rather not as my container currently is extremely small and has no shell nor coreutils.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.quadlet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions