From e728f4b722813384b63ee7bf9467b95d27a2c5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 5 Nov 2019 16:27:33 +0800 Subject: [PATCH] Update Dockerfile and docker-compose.yml, fixes #52, fixes #53, fixes #55 --- docker/Dockerfile | 16 ++++++++++------ docker/docker-compose.yml | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f8e4949..a18913c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,9 +10,11 @@ RUN apt-get update && apt-get upgrade -y \ unzip zip \ && rm -rf /var/lib/apt/lists/* -RUN conda update -n base conda -COPY docker/environment.yml /tmp/ -RUN conda env create -f /tmp/environment.yml +COPY environment.yml /tmp/ +RUN conda update -y -n base conda \ + && conda env create -f /tmp/environment.yml \ + && conda clean -y -t \ + && rm /tmp/environment.yml ARG username ARG userid @@ -30,6 +32,8 @@ RUN chown ${username}:${username} ${workdir} USER ${username} WORKDIR ${workdir} +ENV PATH /opt/conda/envs/tf2/bin:$PATH + # 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") @@ -47,9 +51,9 @@ RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ig COPY docker/bashrc.bash /tmp/ -RUN cat /tmp/bashrc.bash >> ${home}/.bashrc -RUN echo "export PATH=\"${workdir}/docker/bin:$PATH\"" >> ${home}/.bashrc -RUN sudo rm /tmp/bashrc.bash +RUN cat /tmp/bashrc.bash >> ${home}/.bashrc \ + && echo "export PATH=\"${workdir}/docker/bin:$PATH\"" >> ${home}/.bashrc \ + && sudo rm /tmp/bashrc.bash # INFO: Uncomment lines below to enable automatic save of python-only and html-only diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 12eb355..2cbefc5 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -19,4 +19,4 @@ services: - "6006:6006" volumes: - ../:/home/devel/handson-ml2 - command: /opt/conda/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser + command: /opt/conda/envs/tf2/bin/jupyter notebook --ip='0.0.0.0' --port=8888 --no-browser