Running OpenWrt in a Docker container

What do you think should happen if the ping command terminates?

I'm new to this, so please bear with me, but I think it should take me back to OpenWrt's shell, which runs inside the container, and keep the container running.

I'd expect that because when I run OpenWrt via docker, the container asks me to "Please press Enter to activate this console." Only after I press Enter, it starts BusyBox. Then when I type "exit", it doesn't terminate the container. Instead I see "Please press Enter to activate this console" again. Note I simply start the container as sudo docker run --rm -it openwrtorg/rootfs, and what its docker file invokes is CMD ["/sbin/init"].

So why terminating "ping", which I started manually from BusyBox's shell inside the OpenWrt container, would also terminate the shell, and then the container itself?

PS. I've just tried the same with Alpine ("sudo docker run -it alpine") and it worked as I'd expect, i.e., terminating ping with Ctrl+C doesn't kill the container.

1 Like