Skip to content

Instantly share code, notes, and snippets.

@Mason-McGough
Last active January 6, 2021 17:05
Show Gist options
  • Save Mason-McGough/ecf81d40e84971e8f68bdc6e4a5bcc21 to your computer and use it in GitHub Desktop.
Save Mason-McGough/ecf81d40e84971e8f68bdc6e4a5bcc21 to your computer and use it in GitHub Desktop.
Dockerfile for Anaconda
# From https://towardsdatascience.com/docker-for-data-science-9c0ce73e8263
# We will use Ubuntu for our image
FROM ubuntu
# Updating Ubuntu packages
RUN apt-get update && yes|apt-get upgrade
# Adding wget and bzip2
RUN apt-get install -y wget bzip2
# Anaconda installing
RUN wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
RUN bash Anaconda3-5.0.1-Linux-x86_64.sh -b
RUN rm Anaconda3-5.0.1-Linux-x86_64.sh
# Set path to conda
ENV PATH /root/anaconda3/bin:$PATH
# Updating Anaconda packages
RUN conda update conda
RUN conda update anaconda
RUN conda update --all
# Configuring access to Jupyter
RUN mkdir /opt/notebooks
RUN jupyter notebook --generate-config --allow-root
RUN echo "c.NotebookApp.password = u'sha1:6a3f528eec40:6e896b6e4828f525a6e20e5411cd1c8075d68619'" >> /root/.jupyter/jupyter_notebook_config.py
# Jupyter listens port: 8888
EXPOSE 8888
# Run Jupyter notebook as Docker main process
CMD ["jupyter", "notebook", "--allow-root", "--notebook-dir=/opt/notebooks", "--ip='*'", "--port=8888", "--no-browser"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment