I'm trying to make a script to quickly test whether the network connection works inside docker using busybox.
All of these tests failed to timeout after 5 seconds (they took 30 seconds to timeout):
docker run busybox wget -T 5 google.com docker run busybox timeout 5 wget google.com timeout 5 docker run busybox wget google.com
The only thing that worked was to shell into busybox interactively. That did successfully terminate in 5 seconds. But I'm trying to do this programmatically, not interactively.
docker run -it busybox / # timeout 5 wget google.com Terminated
Why did the timeout work in the interactive shell, but does not work non-interactively?
I'm running from an Ubuntu 18:04 VM.