karalabe / xgo

Go CGO cross compiler
MIT License
2.14k stars 279 forks source link

Cleanup leftover docker containers on main process kill #191

Open mcandre opened 4 years ago

mcandre commented 4 years ago

When the user cancels xgo such as with Control+C / SIGINT, then xgo leaves behind the Docker containers still running, which periodically spill logs onto the console.

Please setup some defers so that when the main process terminates, any Docker containers spawned by xgo are automatically cleaned up before handing control back to the user.