For my dissertation at University, I\'m working on a coding leaderboard system where users can compile / run untrusted code through temporary docker containers. The system seems
You could set up your container with a ulimit
on the max CPU time, which will kill the looping process. A malicious user can get around this, though, if they're root inside the container.
There's another S.O. question, "Setting absolute limits on CPU for Docker containers" that describes how to limit the CPU consumption of containers. This would allow you to reduce the effect of malicious users.
I agree with Abdullah, though, that you ought to be able to docker kill
the runaway from your supervisor.