Docker timeout for container?

后端 未结 4 1605
旧巷少年郎
旧巷少年郎 2021-01-31 09:18

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

4条回答
  •  心在旅途
    2021-01-31 09:52

    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.

提交回复
热议问题