Open olexandr-konovalov opened 8 years ago
FEniCS has a script that does many of these things and could be useful as a reference.
start the default browser with the Jupyter session automatically
This can be done in Python with the webbrowser module.
sort out running several containers concurrently at different ports
I see two ways to do this:
use host networking as you are, and allow specifying the port via en environment variable:
docker run -p 8899:8899 -e NB_PORT=8899 --net=host ...
don’t use host networking, and rely on docker’s own ports. In Dockerfile:
EXPOSE 8888
then after starting, discover the port with docker port
I would recommend not using host networking for this, unless your container is likely to need to listen on additional ports.
figuring out the IP address of the VM on Windows and OS X to connect instead of 0.0.0.0.
Typically, the docker host can be found with:
docker-machine ip $(docker-machine active)
The fenics script linked above has this logic.
The only port this thing should ever listen on is the port for the Jupyter notebook server.
Outbound network connectivity is necessary for packages like AtlasRep
that download information from webservers.
Thanks for the link to that script we'll have a look at that.
In the 1st instance, one could create
jgap.sh
(for "Jupyter-GAP") script withthat the user could start (with
sudo
if necessary). The next steps are:0.0.0.0
.