Working with short-lived containers #446
-
How to wait until container finishes its work? Or how to detect that container has exited? I have a console application in a Docker container, and I want to:
I noticed that Java library has |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use a custom wait strategy. Similar to: either wait until the container reaches the exit state or use whatever signals a finished run.
|
Beta Was this translation helpful? Give feedback.
You can use a custom wait strategy. Similar to:
https://github.com/HofmeisterAn/dotnet-testcontainers/blob/de4c4a251152ee2cfdcd4061c8b1bcc0621e692f/src/DotNet.Testcontainers/Configurations/WaitStrategies/UntilContainerIsRunning.cs#L14
either wait until the container reaches the exit state or use whatever signals a finished run.
StartAsync
completes when the wait strategies are successful.GetExitCode
returns the exit code of the container.