Have you actually tried that with a nontrivial setup? It breaks very easily.
For the Docker solution, cf