-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89f5926
commit 580789b
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()" |