diff --git a/docker/Dockerfile b/docker/Dockerfile index 978613a0d46cfe8720fb75accd13d2d054dfbc75..c42037599dc0060cc0b2a67d2fdafa4806d86813 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,11 +1,8 @@ -# TensorFlow GPU image as base -FROM tensorflow/tensorflow:1.15.0-gpu-py3 +# Ubuntu image as base +FROM ubuntu:18.04 # Set environment variables -ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 ENV DEBIAN_FRONTEND=noninteractive -ENV PATH=/opt/conda/bin:$PATH -ARG CUDA=12.2.2 # Install system dependencies RUN apt-get update && apt-get install -y \ @@ -18,13 +15,23 @@ RUN apt-get update && apt-get install -y \ gdebi-core \ && rm -rf /var/lib/apt/lists/* +# Set working directory +WORKDIR /root + # Install Miniconda -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ - /bin/bash ~/miniconda.sh -b -p /opt/conda && \ - rm ~/miniconda.sh +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \ + bash miniconda.sh -b -p /opt/miniconda && \ + rm miniconda.sh + +# Set environment variables for Conda +ENV PATH="/opt/miniconda/bin:$PATH" -# Create Conda environment and install packages -RUN conda create -y -n neuroestimator && \ +# Create .condarc file for channel priority +RUN echo "channels:\n - conda-forge\n - bioconda\n - defaults\n - r" > /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 \ @@ -33,10 +40,14 @@ RUN conda create -y -n neuroestimator && \ r-dplyr=1.0.9 \ r-base \ r-remotes \ - 'r-reticulate<=1.24' && \ + 'r-reticulate<=1.24' + +# Activate environment and install NEUROeSTIMator +RUN /bin/bash -c "source activate neuroestimator && \ + R -e 'remotes::install_git(\"https://research-git.uiowa.edu/michaelson-lab-public/neuroestimator\")'" # Install RStudio Server -RUN wget wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.12.1-563-amd64.deb && \ +RUN wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.12.1-563-amd64.deb && \ gdebi --non-interactive rstudio-server-2024.12.1-563-amd64.deb && \ rm rstudio-server-2024.12.1-563-amd64.deb @@ -47,3 +58,5 @@ RUN useradd -m rstudio && echo "rstudio:rstudio" | chpasswd && adduser rstudio s RUN echo "export PATH=/opt/conda/bin:$PATH" >> /etc/profile.d/conda.sh && \ echo "source activate neuroestimator" >> /home/rstudio/.bashrc +# Set entrypoint to bash +ENTRYPOINT ["/bin/bash"]