I did something like this[1] for a CTF I hosted. It spins up a pod in Kubernetes with a predefined set of images based on the username. e.g. `ssh TeamCode:CHALLENGE_NAME@ssh.coop-ctf.ca` would spin up the container for that team with the image for the challenge.
Since the container could be used by multiple team members, I had an external scripts to tear down after 30min of inactivity.