cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

Waiting container to stop after started container, not before #169

Closed fenngwd closed 4 years ago

fenngwd commented 4 years ago

Waiting container to stop is not working in old Docker API version(1.24).

In old Docker API version(1.24), before docker container started, docker wait will return immediately. In this case, ContainerWait function which creates a goroutine to wait container to stop, may send a message to statusc before container started, and this will make waiting container to stop fail.

Trying to wait container to stop after started container, and this will make waiting container work well.

Related source code: https://github.com/moby/moby/blob/1.12.x/container/state.go#L129

silvin-lubecki commented 4 years ago

Hello @fenngwd, thank you for this PR. It looks like the DCO bot is complaining, could you signoff your commit? Also one integration test related to your changes is failing on the CI, can you reproduce it on your side?

fenngwd commented 4 years ago

@silvin-lubecki I have signoff my commit, and integration test passed. But it seems check hangs.

fenngwd commented 4 years ago

@silvin-lubecki How to solve this? Check hangs...

vdice commented 4 years ago

/brig run