Skip to content

waitContainerCmd is useless when container has autoRemove or is short lived  #2356

Open
@bitstrings

Description

Because we can not change the condition of wait (https://docs.docker.com/reference/api/engine/version/v1.43/#tag/Container/operation/ContainerWait), if the container is destroyed before wait can be used, then we have no way to get the status code.

Also, the fact that we need to exec waitContainerCmd after the container start, is weird.

In my case, I have overridden the WaitContainerCmdExec class so the condition to be next-exit for my use case. With this, I am able to start waiting before starting the container and therefore get the status code.

I recommend having a way to set the condition on wait container.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions