Docker Community Forums

Share and learn in the Docker community.

Docker jupyter notebook socket.gaierror while starting in interactive mode


#1

Hi Team,
I am setting docker for anaconda and jupyter notebook.
Refereed link https://hub.docker.com/r/continuumio/anaconda/

  1. docker pull continuumio/anaconda
  2. docker run -i -t continuumio/anaconda /bin/bash
  3. docker run -i -t -p 8888:8888 continuumio/anaconda /bin/bash -c “/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=’*’ --port=8888 --no-browser”

While performing step 3 getting following error.

infinity@infinity-ThinkPad-T440:~$ docker run -i -t -p 8888:8888 continuumio/anaconda /bin/bash -c “/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=’*’ --port=8888 --no-browser”
Solving environment: …working… done

Package Plan

environment location: /opt/conda

added / updated specs:
- jupyter

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
conda-4.6.4                |           py27_0         1.6 MB

The following packages will be UPDATED:

conda: 4.5.12-py27_0 --> 4.6.4-py27_0

Preparing transaction: …working… done
Verifying transaction: …working… done
Executing transaction: …working… done
[I 07:07:38.385 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
Traceback (most recent call last):
File “/opt/conda/bin/jupyter-notebook”, line 11, in
sys.exit(main())
File “/opt/conda/lib/python2.7/site-packages/jupyter_core/application.py”, line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/opt/conda/lib/python2.7/site-packages/traitlets/config/application.py”, line 657, in launch_instance
app.initialize(argv)
File “”, line 2, in initialize
File “/opt/conda/lib/python2.7/site-packages/traitlets/config/application.py”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/opt/conda/lib/python2.7/site-packages/notebook/notebookapp.py”, line 1628, in initialize
self.init_webapp()
File “/opt/conda/lib/python2.7/site-packages/notebook/notebookapp.py”, line 1378, in init_webapp
self.jinja_environment_options,
File “/opt/conda/lib/python2.7/site-packages/notebook/notebookapp.py”, line 159, in init
default_url, settings_overrides, jinja_env_options)
File “/opt/conda/lib/python2.7/site-packages/notebook/notebookapp.py”, line 252, in init_settings
allow_remote_access=jupyter_app.allow_remote_access,
File “/opt/conda/lib/python2.7/site-packages/traitlets/traitlets.py”, line 556, in get
return self.get(obj, cls)
File “/opt/conda/lib/python2.7/site-packages/traitlets/traitlets.py”, line 535, in get
value = self._validate(obj, dynamic_default())
File “/opt/conda/lib/python2.7/site-packages/notebook/notebookapp.py”, line 867, in _default_allow_remote
for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known
infinity@infinity-ThinkPad-T440:~$

Help

Regards,
Swaroop


(Doug Morse) #2

@swaroops: I changed the --ip='*' parameter for /opt/conda/bin/jupyter to --ip='0.0.0.0' and added a --allow-root parameter (i.e., after the --no-browser parameter) and all was well.