From 7692535495d506dfbaffbcaef2fbc3f9c36f30a2 Mon Sep 17 00:00:00 2001 From: Dani Arribas-Bel Date: Fri, 5 May 2023 12:02:38 +0100 Subject: [PATCH] Builder for gdsrpy:2.0 ready --- pystack/Dockerfile | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/pystack/Dockerfile b/pystack/Dockerfile index 001ff5b..2860fcb 100644 --- a/pystack/Dockerfile +++ b/pystack/Dockerfile @@ -1,29 +1,27 @@ -FROM darribas/gdsr:1.0 +FROM darribas/gdsr:2.0 LABEL org.label-schema.license="GPL-2.0" \ org.label-schema.vcs-url="https://github.com/gdsl-ul/gdsr" \ org.label-schema.vendor="Geographic Data Science Lab" \ maintainer="Dani Arribas-Bel " -# Install Miniconda -RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - -O $HOME/miniconda.sh && \ - sh $HOME/miniconda.sh -b -p /opt/conda && \ - rm $HOME/miniconda.sh && \ - ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ - echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ - echo "conda activate base" >> $HOME/.bashrc && \ - find /opt/conda/ -follow -type f -name '*.a' -delete && \ - find /opt/conda/ -follow -type f -name '*.js.map' -delete && \ - /opt/conda/bin/conda clean -afy +# Install Mambaforge +RUN wget -O Mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \ + && bash Mambaforge.sh -b -p "/opt/conda" \ + && echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/rstudio/.bashrc \ + && echo ". /opt/conda/etc/profile.d/mamba.sh" >> /home/rstudio/.bashrc \ + && echo "conda activate base" >> /home/rstudio/.bashrc ENV PATH="/opt/conda/bin:${PATH}" +RUN cat /home/rstudio/.bashrc +USER rstudio +# Install GDS env +RUN . /opt/conda/etc/profile.d/conda.sh \ + && . /opt/conda/etc/profile.d/mamba.sh \ + && conda activate \ + && mamba create --name gds --file https://github.com/darribas/gds_env/raw/v9.1/gds_py/gds_py_explicit_ubuntu-latest.txt \ + && mamba activate gds \ + && pip install -r https://github.com/darribas/gds_env/raw/v9.1/gds_py/gds_py_pip.txt -# Install GDS environment -RUN conda env create -f https://github.com/darribas/gds_env/raw/v6.1/gds_py/gds_py.yml -RUN bash -c "source /opt/conda/etc/profile.d/conda.sh && \ - conda activate gds && \ - pip install -r https://github.com/darribas/gds_env/raw/v6.1/gds_py/gds_py_pip.txt" -EXPOSE 8888 - +USER root # Install reticulate RUN R -e "install.packages('reticulate', repos='https://cran.rstudio.com');"