Docker Community Forums

Share and learn in the Docker community.

Docker jupyter notebook socket.gaierror while starting in interactive mode


Hi Team,
I am setting docker for anaconda and jupyter notebook.
Refereed link

  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
File “/opt/conda/lib/python2.7/site-packages/jupyter_core/”, line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/opt/conda/lib/python2.7/site-packages/traitlets/config/”, line 657, in launch_instance
File “”, line 2, in initialize
File “/opt/conda/lib/python2.7/site-packages/traitlets/config/”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/opt/conda/lib/python2.7/site-packages/notebook/”, line 1628, in initialize
File “/opt/conda/lib/python2.7/site-packages/notebook/”, line 1378, in init_webapp
File “/opt/conda/lib/python2.7/site-packages/notebook/”, line 159, in init
default_url, settings_overrides, jinja_env_options)
File “/opt/conda/lib/python2.7/site-packages/notebook/”, line 252, in init_settings
File “/opt/conda/lib/python2.7/site-packages/traitlets/”, line 556, in get
return self.get(obj, cls)
File “/opt/conda/lib/python2.7/site-packages/traitlets/”, line 535, in get
value = self._validate(obj, dynamic_default())
File “/opt/conda/lib/python2.7/site-packages/notebook/”, 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



(Doug Morse) #2

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