2019-06-04 10:43:14 +02:00
|
|
|
FROM continuumio/anaconda3:2019.03
|
2017-11-21 20:24:43 +01:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get upgrade -y \
|
2017-12-11 22:02:42 +01:00
|
|
|
&& apt-get install -y \
|
|
|
|
libpq-dev \
|
|
|
|
build-essential \
|
|
|
|
git \
|
|
|
|
sudo \
|
2018-03-21 22:21:54 +01:00
|
|
|
cmake zlib1g-dev libjpeg-dev xvfb libav-tools xorg-dev libboost-all-dev libsdl2-dev swig \
|
2019-06-04 10:43:14 +02:00
|
|
|
unzip zip \
|
2017-12-11 22:02:42 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2017-11-27 17:16:51 +01:00
|
|
|
|
2018-03-02 18:44:05 +01:00
|
|
|
RUN conda update -n base conda
|
2019-06-04 10:43:14 +02:00
|
|
|
RUN conda install -y \
|
|
|
|
joblib \
|
|
|
|
PyYAML==3.13
|
2017-11-27 17:16:51 +01:00
|
|
|
RUN conda install -y -c conda-forge \
|
2019-06-04 10:43:14 +02:00
|
|
|
pyopengl \
|
|
|
|
xgboost \
|
|
|
|
nbdime
|
|
|
|
RUN pip install "urlextract"
|
2018-03-21 22:21:54 +01:00
|
|
|
RUN pip install "gym[atari,box2d,classic_control]"
|
2019-06-04 10:43:14 +02:00
|
|
|
RUN pip install "tensorflow-hub"
|
|
|
|
RUN pip install "tensorflow-serving-api"
|
|
|
|
RUN pip install "tfx"
|
|
|
|
#RUN pip install "tensorflow-addons"
|
|
|
|
RUN pip install "tf-agents-nightly"
|
|
|
|
RUN pip install "tfds-nightly"
|
|
|
|
RUN pip install "tfp-nightly"
|
|
|
|
RUN pip uninstall -y tensorflow
|
|
|
|
RUN pip uninstall -y tensorboard
|
|
|
|
RUN pip install "tf-nightly-2.0-preview"
|
|
|
|
RUN pip install "tb-nightly"
|
|
|
|
|
2017-11-27 17:16:51 +01:00
|
|
|
|
|
|
|
ARG username
|
2017-11-28 10:33:20 +01:00
|
|
|
ARG userid
|
2017-11-27 17:16:51 +01:00
|
|
|
|
2017-12-04 11:33:16 +01:00
|
|
|
ARG home=/home/${username}
|
2019-06-04 10:43:14 +02:00
|
|
|
ARG workdir=${home}/handson-ml2
|
2017-12-04 11:33:16 +01:00
|
|
|
|
2017-11-29 16:20:07 +01:00
|
|
|
RUN adduser ${username} --uid ${userid} --gecos '' --disabled-password \
|
2017-12-11 22:02:42 +01:00
|
|
|
&& echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} \
|
|
|
|
&& chmod 0440 /etc/sudoers.d/${username}
|
2017-11-27 17:16:51 +01:00
|
|
|
|
2017-11-30 12:09:16 +01:00
|
|
|
WORKDIR ${workdir}
|
|
|
|
RUN chown ${username}:${username} ${workdir}
|
2017-11-27 17:16:51 +01:00
|
|
|
|
|
|
|
USER ${username}
|
2019-06-04 10:43:14 +02:00
|
|
|
WORKDIR ${workdir}
|
2017-11-27 17:16:51 +01:00
|
|
|
|
2019-06-04 10:43:14 +02:00
|
|
|
# The config below enables diffing notebooks with nbdiff (and nbdiff support
|
|
|
|
# in git diff command) after connecting to the container by "make exec" (or
|
|
|
|
# "docker-compose exec handson-ml2 bash")
|
2017-12-01 10:56:36 +01:00
|
|
|
# You may also try running:
|
2019-06-04 10:43:14 +02:00
|
|
|
# nbdiff NOTEBOOK_NAME.ipynb
|
|
|
|
# to get nbdiff between checkpointed version and current version of the
|
|
|
|
# given notebook.
|
2017-11-21 20:24:43 +01:00
|
|
|
|
2017-11-29 16:20:07 +01:00
|
|
|
RUN git-nbdiffdriver config --enable --global
|
|
|
|
|
2017-12-01 10:56:36 +01:00
|
|
|
# INFO: Optionally uncomment any (one) of the following RUN commands below to ignore either
|
2017-11-30 12:09:16 +01:00
|
|
|
# metadata or details in nbdiff within git diff
|
2017-11-29 16:20:07 +01:00
|
|
|
#RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ignore-metadata'
|
2017-12-01 10:56:36 +01:00
|
|
|
RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ignore-details'
|
2017-11-30 12:09:16 +01:00
|
|
|
|
|
|
|
|
2017-12-11 16:19:24 +01:00
|
|
|
COPY docker/bashrc.bash /tmp/
|
|
|
|
RUN cat /tmp/bashrc.bash >> ${home}/.bashrc
|
2017-12-09 20:17:56 +01:00
|
|
|
RUN echo "export PATH=\"${workdir}/docker/bin:$PATH\"" >> ${home}/.bashrc
|
2017-12-11 16:19:24 +01:00
|
|
|
RUN sudo rm /tmp/bashrc.bash
|
|
|
|
|
|
|
|
|
|
|
|
# INFO: Uncomment lines below to enable automatic save of python-only and html-only
|
|
|
|
# exports alongside the notebook
|
|
|
|
#COPY docker/jupyter_notebook_config.py /tmp/
|
|
|
|
#RUN cat /tmp/jupyter_notebook_config.py >> ${home}/.jupyter/jupyter_notebook_config.py
|
|
|
|
#RUN sudo rm /tmp/jupyter_notebook_config.py
|
2017-11-30 12:59:26 +01:00
|
|
|
|
2019-06-04 10:43:14 +02:00
|
|
|
|
2017-12-01 10:56:36 +01:00
|
|
|
# INFO: Uncomment the RUN command below to disable git diff paging
|
|
|
|
#RUN git config --global core.pager ''
|
2017-11-30 12:59:26 +01:00
|
|
|
|
2019-06-04 10:43:14 +02:00
|
|
|
|
2017-12-01 10:56:36 +01:00
|
|
|
# INFO: Uncomment the RUN command below for easy and constant notebook URL (just localhost:8888)
|
2019-06-04 10:43:14 +02:00
|
|
|
# That will switch Jupyter to using empty password instead of a token.
|
2017-12-01 10:56:36 +01:00
|
|
|
# To avoid making a security hole you SHOULD in fact not only uncomment but
|
|
|
|
# regenerate the hash for your own non-empty password and replace the hash below.
|
|
|
|
# You can compute a password hash in any notebook, just run the code:
|
|
|
|
# from notebook.auth import passwd
|
|
|
|
# passwd()
|
|
|
|
# and take the hash from the output
|
2017-12-04 11:33:16 +01:00
|
|
|
#RUN mkdir -p ${home}/.jupyter && \
|
2017-12-11 22:02:42 +01:00
|
|
|
# echo 'c.NotebookApp.password = u"sha1:c6bbcba2d04b:f969e403db876dcfbe26f47affe41909bd53392e"' \
|
|
|
|
# >> ${home}/.jupyter/jupyter_notebook_config.py
|