title: How to dockerize Jupyter lab
body: <p>I'm trying to dockerize the <a href="https://github.com/jupyterlab/jupyterlab" rel="noreferrer">Jupyter Lab</a> and so I tried to create a <code>Dockerfile</code> as below,<br></p>
  
  <pre><code>FROM python:3.6
  
  WORKDIR /jup
  
  RUN pip install jupyter -U &amp;&amp; pip install jupyterlab
  
  EXPOSE 8888
  
  ENTRYPOINT ["jupyter", "lab"]
  </code></pre>
  
  <p><br>
  and  run the commands, <code>docker build . -t jupyter</code> then <code>docker run jupyter</code>. But unfortunately I got some error as below<br></p>
  
  <pre><code>[I 07:56:34.123 LabApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
  Traceback (most recent call last):
    File "/usr/local/bin/jupyter-lab", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
      app.initialize(argv)
    File "&lt;decorator-gen-7&gt;", line 2, in initialize
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
      return method(app, *args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1507, in initialize
      self.init_webapp()
    File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1297, in init_webapp
      self.http_server.listen(port, self.ip)
    File "/usr/local/lib/python3.6/site-packages/tornado/tcpserver.py", line 142, in listen
      sockets = bind_sockets(port, address=address)
    File "/usr/local/lib/python3.6/site-packages/tornado/netutil.py", line 197, in bind_sockets
      sock.bind(sockaddr)
  OSError: [Errno 99] Cannot assign requested address
  </code></pre>
  
  <p><br>
  How can I dockerize <code>jupyter lab</code> ? [ by solving this error ]</p>