Skip to content

Commit

Permalink
Edit dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Jun 22, 2019
1 parent 89f5926 commit 580789b
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
FROM rocker/binder:3.6.0
LABEL maintainer='Will Landau'
USER root

ENV WORKON_HOME /opt/virtualenvs
ENV PYTHON_VENV_PATH $WORKON_HOME/r-tensorflow

RUN apt-get update && apt-get install -y --no-install-recommends \
libpython3-dev \
python3-venv \
libzmq3-dev && \
rm -rf /var/lib/apt/lists/*

RUN python3 -m venv ${PYTHON_VENV_PATH}

RUN chown -R ${NB_USER} ${WORKON_HOME}

ENV PATH ${PYTHON_VENV_PATH}/bin:${PATH}
## And set ENV for R! It doesn't read from the environment...
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron && \
echo "WORKON_HOME=${WORKON_HOME}" >> /usr/local/lib/R/etc/Renviron && \
echo "RETICULATE_PYTHON_ENV=${PYTHON_VENV_PATH}" >> /usr/local/lib/R/etc/Renviron

## Because reticulate hardwires these PATHs...
RUN ln -s ${PYTHON_VENV_PATH}/bin/pip /usr/local/bin/pip && \
ln -s ${PYTHON_VENV_PATH}/bin/virtualenv /usr/local/bin/virtualenv

## install as user to avoid venv issues later
USER ${NB_USER}
RUN pip3 install \
h5py==2.9.0 \
pyyaml==3.13 \
requests==2.21.0 \
Pillow==5.4.1 \
tensorflow==1.12.0 \
tensorflow-probability==0.5.0 \
keras==2.2.4 \
--no-cache-dir

USER root
RUN install2.r reticulate tensorflow keras

COPY . ${HOME}
RUN chown -R ${NB_USER} ${HOME}
USER ${NB_USER}

RUN wget https://github.com/wlandau/drake-examples/raw/master/DESCRIPTION && R -e "options(repos = list(CRAN = 'http://mran.revolutionanalytics.com/snapshot/2019-06-21/')); devtools::install_deps()"

0 comments on commit 580789b

Please sign in to comment.