Skip to content

Instantly share code, notes, and snippets.

@romandvoskin
Last active February 10, 2019 04:50
Show Gist options
  • Save romandvoskin/750ca86b7bc2b874356fb8cfd8b77dce to your computer and use it in GitHub Desktop.
Save romandvoskin/750ca86b7bc2b874356fb8cfd8b77dce to your computer and use it in GitHub Desktop.
Run continuumio/anaconda on Docker on a Mac

Steps

Pre-Req: Use Docker for Mac

  1. Get the image via docker pull continuumio/anaconda
  2. Create a directory for notebooks. Ex: mkdir ~/notebooks
  3. Run docker image and use the created directory as a mounted volume via docker run -d -p 8888:8888 -v ~/notebooks:/opt/notebooks continuumio/anaconda /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir -p /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip=0.0.0.0 --port=8888 --no-browser --allow-root"
  4. Get the docker container id via docker ps | grep -i "continuumio/anaconda" | awk '{print $1}'
  5. Wait 60 seconds for the container to install software
  6. Get the URL and token to access Jupyter via docker logs <containerId> NOTE: You may have to keep repeating docker logs ... until you see output like this:
To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-7-open.html
    Or copy and paste one of these URLs:
        http://127.0.0.1:8888/?token=fd5b9819968056b638ed4d7659f33dd3ce804103ba7aa653
  1. Finally you can access the site via browser using the address like this http://127.0.0.1:8888/?token=fd5b9819968056b638ed4d7659f33dd3ce804103ba7aa653
  2. All saved files will be located in the mounted directory. Ex: ~/notebooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment