Skip to content

Instantly share code, notes, and snippets.

@keenle
Last active January 3, 2020 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keenle/0f06125955228c8e56c1858abe5e83e5 to your computer and use it in GitHub Desktop.
Save keenle/0f06125955228c8e56c1858abe5e83e5 to your computer and use it in GitHub Desktop.
Run jupyter/datascience-notebook in Docker

Run jupyter/datascience-notebook in Docker

Following steps assume macOS.

  1. Open Terminal window.
  2. Create a folder that will be mapped into your Jupyter container.
    $ mkdir ~/Desktop/datascience
    
  3. Run jupyter/datascience-notebook
    $ docker run -d -p 8888:8888 -v ~/Desktop/datascience:/home/jovyan/work jupyter/datascience-notebook
    
  4. Checkout newly started container logs to get Jupyter access token.
    $ docker logs $(docker ps -lq)
    ... truncated ...
    [I 00:31:33.243 NotebookApp] The Jupyter Notebook is running at:
    [I 00:31:33.244 NotebookApp] http://9893b622d563:8888/?token=0a2b33cc7f9e590d7c99a52ac7664f0c76348c45cdb052f6
    [I 00:31:33.244 NotebookApp]  or http://127.0.0.1:8888/?token=0a2b33cc7f9e590d7c99a52ac7664f0c76348c45cdb052f6
    [I 00:31:33.244 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [C 00:31:33.257 NotebookApp] 
        
        To access the notebook, open this file in a browser:
            file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
        Or copy and paste one of these URLs:
            http://9893b622d563:8888/?token=0a2b33cc7f9e590d7c99a52ac7664f0c76348c45cdb052f6
         or http://127.0.0.1:8888/?token=0a2b33cc7f9e590d7c99a52ac7664f0c76348c45cdb052f6
    
  5. Navigate to http://127.0.0.1:8888 and paste 0a2b33cc7f9e590d7c99a52ac7664f0c76348c45cdb052f6 into token textbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment