https://rancher.com/ logo
Title
p

powerful-elephant-25838

06/08/2022, 3:17 PM
on windows 10 with powershell executing "docker run ..." the container cannot be stopped with ctlr-c, any hint on how to solve?
w

wide-mechanic-33041

06/08/2022, 3:21 PM
you mean docker stop?
p

powerful-elephant-25838

06/08/2022, 3:24 PM
No, I execute docker run (without -d) and the container start normally but if I want to stop it normally I can do a ctlr-c (at least in linux 😄) In windows it does not work I have to open a second powershell and do a docker kill or stop from there
w

wide-mechanic-33041

06/08/2022, 3:24 PM
yeah guessing thats just the reality of the container running on the other side of the sock
p

powerful-elephant-25838

06/08/2022, 3:25 PM
so no workaround?
w

wide-mechanic-33041

06/08/2022, 3:25 PM
ctrl-c is being eaten by windows vs handed through
not that i am aware of
i would say just background the run
p

powerful-elephant-25838

06/08/2022, 3:26 PM
yes that is the thing I'll end up doing but hoped for a better solution any idea why this happen?
w

wide-mechanic-33041

06/08/2022, 3:27 PM
guessing the sigint is being eaten by windows and not relayed into the VM
you could open an issue as maybe the shim could catch it and relay. Sometimes windows can be a little grabby
p

powerful-elephant-25838

06/08/2022, 3:32 PM
if I add -it option it seems to get the ctlr-c
w

wide-mechanic-33041

06/08/2022, 3:32 PM
yeah interactive vs foreground
but as you note if you run it foreground directly than it respects sigint
s

sticky-summer-13450

06/10/2022, 8:20 AM
I don't think you can guarantee
ctrl-c
will stop a
docker run
without
-it
on any platform - I think it works on some platforms but I think that's undefined behaviour