how to use docker?

Here is a simple jupyter example doing exactly that. Starting each app within the same process.