Maybe Jessica McKellar's "Building and Breaking a Python Sandbox" talk can bring some ideas. (But maybe not! It might be too Python-specific or too language-level whereas you want to remain at a higher level with just Docker)
Video: https://www.youtube.com/watch?v=sL_syMmRkoU
Slides: https://speakerdeck.com/pycon2014/building-and-breaking-a-py...