diff --git a/docker/Dockerfile b/docker/Dockerfile index 694fd1ac36fafd32c53b9f9fb4aeac923121ba33..90c5043c2c7a359be022d0b0e43fe9dbb27c951b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM tensorflow/tensorflow:1.15.0 AS tensorflow +FROM rocker/rstudio:4.3.3 AS rstudio # Set noninteractive mode to prevent prompts during installation ENV DEBIAN_FRONTEND=noninteractive @@ -31,32 +31,17 @@ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh - ENV PATH="/opt/miniconda/bin:$PATH" # Create .condarc file for channel priority -RUN echo "channels:\n - conda-forge\n - bioconda\n - defaults\n - r" > /root/.condarc +RUN echo "channels:\n - conda-forge\n - bioconda" > /root/.condarc # Create Conda environment and install dependencies RUN conda create --name neuroestimator -y \ - tensorflow=1.15.0 \ - tensorflow-estimator=1.15.1 \ - r-keras=2.3.0.0 \ - r-tensorflow=2.2.0 \ + python=3.7 \ h5py=2.10.0 \ - hdf5=1.10.6 \ - r-dplyr=1.0.9 \ - r-base \ - r-remotes \ - 'r-reticulate<=1.24' - -# Rstudio setup -FROM rocker/rstudio:4.3.3 AS rstudio - -# Set environment variables - -ENV DEBIAN_FRONTEND=noninteractive -ENV PATH="/opt/miniconda/bin:$PATH" + hdf5=1.10.6 -# Copy Tensorflow and Miniconda environment -COPY --from=tensorflow /opt/miniconda /opt/miniconda -COPY --from=tensorflow /root/.condarc /root/.condarc +# Activate the Conda environment and install Tensorflow via Pip +RUN /bin/bash -c "source activate neuroestimator && \ + pip install tensorflow==1.15.0 tensorflow-estimator==1.15.1" # Create an Rstudio User @@ -68,7 +53,12 @@ RUN id -u rstudio >/dev/null 2>&1 || useradd -m -s /bin/bash rstudio && \ RUN echo 'export RSTUDIO_WHICH_R="/opt/miniconda/envs/neuroestimator/bin/R"' >> /etc/profile.d/rstudio.sh # Install NEUROeSTIMator in the Conda environment -RUN conda run -n neuroestimator R -e "remotes::install_git('https://research-git.uiowa.edu/michaelson-lab-public/neuroestimator')" +RUN conda run -n neuroestimator Rscript -e "install.packages('remotes')" +RUN conda run -n neuroestimator Rscript -e "remotes::install_version('dplyr',version='1.0.9')" +RUN conda run -n neuroestimator Rscript -e "remotes::install_version('keras',version='2.3.0')" +RUN conda run -n neuroestimator Rscript -e "remotes::install_version('tensorflow',version='2.2.0')" +RUN conda run -n neuroestimator Rscript -e "remotes::install_version('reticulate',version='1.24')" +RUN conda run -n neuroestimator Rscript -e "remotes::install_git('https://research-git.uiowa.edu/michaelson-lab-public/neuroestimator')" # Ensure Conda environment is activated on container start SHELL ["/bin/bash", "-c"]