The code running part seems to have been hugged to death, but I like the idea. Any chance the snippets could be made to run locally, either on my own server, or better yet within the user's browser itself?
Well, there is http://code.runnable.com/ which does something similar. I don't remember if it outputted a dockerfile, but I do know it runs everything inside docker. I used to work at the company.