Skip to content

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

Description

@bitstrings

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions