gap-system / gap-docker-jupyter

Docker container for the GAP Jupyter interface
GNU General Public License v2.0
4 stars 2 forks source link

Provide shell script that starts everything #2

Open olexandr-konovalov opened 8 years ago

olexandr-konovalov commented 8 years ago

In the 1st instance, one could create jgap.sh (for "Jupyter-GAP") script with

docker run -p 8888:8888 -i -t --net="host" gapsystem/gap-docker-jupyter

that the user could start (with sudo if necessary). The next steps are:

minrk commented 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:

  1. 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 ...
  2. 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.

markuspf commented 8 years ago

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.