Skip to content

Commit c078076

Browse files
committed
R image: resolved remaining conda/libmamba errors; moved some R dependencies from Dockerfile to conda env file
1 parent 2ee13e1 commit c078076

File tree

3 files changed

+60
-17
lines changed

3 files changed

+60
-17
lines changed

r/Dockerfile

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#syntax=docker/dockerfile:1.3
22
# FROM continuumio/miniconda3:4.12.0@sha256:58b1c7df8d69655ffec017ede784a075e3c2e9feff0fc50ef65300fc75aa45ae
3-
FROM continuumio/miniconda3:24.9.2-0@sha256:39b820af05f0f9bb986ca145a0d077bbd3bd866256277dd869fefb93bd03cd21
3+
# 11/14/24: Use a miniconda image that's a bit older than the rstudio-server package; just in case
4+
FROM continuumio/miniconda3:24.7.1-0@sha256:f37f8c7db26ae7ec0098df530e96c9cde139026b9faf3914800d1522c47a49b1
45

56
ENV NB_USER jovyan
67
ENV NB_UID 1000
@@ -42,10 +43,6 @@ RUN --mount=type=cache,id=ohw_r_apt,target=/var/cache/apt \
4243
sudo \
4344
# 11/14/24: should this lib version be udpated?
4445
libapparmor1 \
45-
# 11/14/24: Neither libarchive-dev nor libarchive13 solved the error:
46-
# Error while loading conda entry point: conda-libmamba-solver (libarchive.so.20: cannot open shared object file: No such file or directory)
47-
# libarchive-dev \
48-
libarchive13 \
4946
libfmt-dev \
5047
# 11/14/24: should this lib version be udpated?
5148
libpq5 \
@@ -81,9 +78,11 @@ COPY ./conda-linux-64.lock /tmp/
8178

8279
RUN --mount=type=cache,id=ohw_r,target=${CONDA_DIR}/pkgs,uid=${NB_UID},gid=${NB_UID} \
8380
# https://github.com/jupyterhub/jupyterhub-deploy-docker/issues/91#issuecomment-525563836
84-
conda update -n root conda && \
81+
# To avoid libmamba and libarchive channel conflicts, make sure conda-forge is the only channel
82+
# https://github.com/conda/conda-libmamba-solver/issues/283#issuecomment-1949560105
83+
conda config --add channels conda-forge && \
84+
conda update --all && \
8585
conda install --name ${CONDA_ENV} --file /tmp/conda-linux-64.lock && \
86-
# micromamba install --name ${CONDA_ENV} --file environment.yml && \
8786
find -name '*.a' -delete && \
8887
# rm -rf /opt/conda/conda-meta && \
8988
rm -rf ${CONDA_DIR}/include && \
@@ -95,9 +94,10 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
9594
# 2024-10-10: Have there been improvements in install_cran and install_github such that
9695
# dependencies, upgrade_dependencies, upgrade could now be set to TRUE or the default?
9796
# RUN installGithub.R BigelowLab/rasf BigelowLab/ohwobpg # not working on GH but works locally :-/
98-
RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
99-
Rscript -e "remotes::install_cran('forecast', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
100-
Rscript -e "remotes::install_cran('ggspatial', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
97+
RUN \
98+
# -- Dependencies to the target packages, not already installed via the conda environment
99+
Rscript -e "remotes::install_cran('PBSMapping', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
100+
# -- Target packages
101101
Rscript -e "remotes::install_cran('plot.matrix', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
102102
Rscript -e "remotes::install_cran('isdparser', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
103103
Rscript -e "remotes::install_cran('geonames', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
@@ -117,7 +117,6 @@ RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_
117117
Rscript -e "remotes::install_github('hvillalo/echogram', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
118118
Rscript -e "remotes::install_github('hvillalo/periods', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
119119
Rscript -e "remotes::install_github('hvillalo/satin', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
120-
Rscript -e "remotes::install_github('kwstat/pals', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
121120
Rscript -e "remotes::install_github('JorGarMol/VoCC', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)"
122121

123122
COPY CONDARC ./.condarc

0 commit comments

Comments
 (0)