Docker Community Forums

Share and learn in the Docker community.

Socket Error when Running Image

Hello all,

I am currently trying to make a container after successfully building an image. The container is made, but it will not run and seems to return with the exit code (1). Looking at the log from the container, the last line seems to indicate that this is a socket error, but I have double checked that the socket is free (through Jupyter Notebook, which the image calls for). Is there something that I am missing in the set up? Versions, commands, and log are as follows.

OS: Windows Home v2004 build 19041
Docker Desktop: 2.4.0.0
Docker Quickstart Toolbox: 19.03.1
VirtualBox: 6.0.24
Python: 2.7
Jupyter Notebook: 5.7.10

The dockerfile can be found from this website: https://github.com/deep-scaffold/molecule_generator/tree/master/dockerfile

In Windows Powershell running as administrator, I do the following.

$ docker build . -t image_name

Once this is successful, I then do:

$ docker run --publish 8000:8888 --detach --name container_name image_name

This makes the container on the Docker dashboard, but hitting “run” only makes it briefly activate before turning off again. The error log is as follows.

Missing privilege separation directory: /var/run/sshd
[I 17:16:07.708 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
Traceback (most recent call last):
File “/usr/local/bin/jupyter-notebook”, line 8, in
sys.exit(main())
File “/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py”, line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py”, line 663, in launch_instance
app.initialize(argv)
File “”, line 2, in initialize
File “/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py”, line 1630, in initialize
self.init_webapp()
File “/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py”, line 1407, in init_webapp
self.http_server.listen(port, self.ip)
File “/usr/local/lib/python2.7/dist-packages/tornado/tcpserver.py”, line 143, in listen
sockets = bind_sockets(port, address=address)
File “/usr/local/lib/python2.7/dist-packages/tornado/netutil.py”, line 168, in bind_sockets
sock.bind(sockaddr)
File “/usr/lib/python2.7/socket.py”, line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
Missing privilege separation directory: /var/run/sshd
Traceback (most recent call last):
File “/usr/local/bin/jupyter-notebook”, line 8, in
sys.exit(main())
File “/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py”, line 270, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py”, line 663, in launch_instance
app.initialize(argv)
File “”, line 2, in initialize
File “/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py”, line 1630, in initialize
self.init_webapp()
File “/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py”, line 1407, in init_webapp
self.http_server.listen(port, self.ip)
File “/usr/local/lib/python2.7/dist-packages/tornado/tcpserver.py”, line 143, in listen
sockets = bind_sockets(port, address=address)
File “/usr/local/lib/python2.7/dist-packages/tornado/netutil.py”, line 168, in bind_sockets
sock.bind(sockaddr)
File “/usr/lib/python2.7/socket.py”, line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address

Searching online suggests that this can be fixed by either reformatting the IP address which I have tried to three separate ones with no success. I have also checked that the exposed port also works and tried changing that to no avail.

If this is not a Docker problem please let me know so that I can try finding the right area to ask.

Thank you!