You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await _dockerClient.Images.BuildImageFromDockerfileAsync returns immediately and does not wait for the image to be created.
When debugging, put a breakpoint immediately after await CreateImageFromDockerFile(stream, "Dockerfile_test_builder", "builder");
In a separate terminal, execute the command docker images. Initially, the image is not there. If I wait patiently, the image does appear after ~1 minute. Wait a little longer and it then gets labeled builder as expected. I can then continue and start the container successfully.
I have successfully awaited await _dockerClient.Images.CreateImageAsync for other images I require within this solution using a similar approach.
I appear to have hit this as well. More importantly, it appears there is no handling of the output of this API call to properly record errors, at least in my situation. The raw command output is passed into the Stream returned by the call. It appears this API call has not been completed in this library, and is in an MVP state.
To ensure the image has been created, you have to read the stream that is returned. However, I have also had problems doing this and the stream being forcibly closed after reading to the end but I just surrounded that with a try-catch.
await _dockerClient.Images.BuildImageFromDockerfileAsync
returns immediately and does not wait for the image to be created.When debugging, put a breakpoint immediately after
await CreateImageFromDockerFile(stream, "Dockerfile_test_builder", "builder");
In a separate terminal, execute the command
docker images
. Initially, the image is not there. If I wait patiently, the image does appear after ~1 minute. Wait a little longer and it then gets labeled builder as expected. I can then continue and start the container successfully.I have successfully awaited
await _dockerClient.Images.CreateImageAsync
for other images I require within this solution using a similar approach.Please could you advise?
Output of
dotnet --info
:What version of Docker.DotNet?:
Steps to reproduce the issue:
What actually happened?:
await _dockerClient.Images.BuildImageFromDockerfileAsync didn't await for the creation to be complete.
What did you expect to happen?:
As with CreateImageAsync, I expected BuildImageFromDockerfileAsync to wait until the image as built.
Additional information:
The text was updated successfully, but these errors were encountered: