Update Dockerfile and docker-compose.yml, fixes #52, fixes #53, fixes #55

main
Aurélien Geron 2019-11-05 16:27:33 +08:00
parent 35bcff5450
commit e728f4b722
2 changed files with 11 additions and 7 deletions

View File

@ -10,9 +10,11 @@ RUN apt-get update && apt-get upgrade -y \
unzip zip \ unzip zip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN conda update -n base conda COPY environment.yml /tmp/
COPY docker/environment.yml /tmp/ RUN conda update -y -n base conda \
RUN conda env create -f /tmp/environment.yml && conda env create -f /tmp/environment.yml \
&& conda clean -y -t \
&& rm /tmp/environment.yml
ARG username ARG username
ARG userid ARG userid
@ -30,6 +32,8 @@ RUN chown ${username}:${username} ${workdir}
USER ${username} USER ${username}
WORKDIR ${workdir} WORKDIR ${workdir}
ENV PATH /opt/conda/envs/tf2/bin:$PATH
# The config below enables diffing notebooks with nbdiff (and nbdiff support # The config below enables diffing notebooks with nbdiff (and nbdiff support
# in git diff command) after connecting to the container by "make exec" (or # in git diff command) after connecting to the container by "make exec" (or
# "docker-compose exec handson-ml2 bash") # "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/ COPY docker/bashrc.bash /tmp/
RUN cat /tmp/bashrc.bash >> ${home}/.bashrc RUN cat /tmp/bashrc.bash >> ${home}/.bashrc \
RUN echo "export PATH=\"${workdir}/docker/bin:$PATH\"" >> ${home}/.bashrc && echo "export PATH=\"${workdir}/docker/bin:$PATH\"" >> ${home}/.bashrc \
RUN sudo rm /tmp/bashrc.bash && sudo rm /tmp/bashrc.bash
# INFO: Uncomment lines below to enable automatic save of python-only and html-only # INFO: Uncomment lines below to enable automatic save of python-only and html-only

View File

@ -19,4 +19,4 @@ services:
- "6006:6006" - "6006:6006"
volumes: volumes:
- ../:/home/devel/handson-ml2 - ../:/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