If you are relying on Docker as a security boundary you are making a mistake.
Docker isolation is good enough to keep honest people honest but isn't good enough to keep out malicious actors. The Linux kernel API is simply too large of an attack surface to be highly secure.
If you want to run completely untrusted software you want a VM boundary at a very minimum. Ideally run it on completely separate hardware. There are few exceptions like browser isolation and gVisor which are strong software isolation without a VM but docker or any Linux container runner is not on that list. If the software has direct access to the host kernel it shouldn't be considered secure.