1
1
# syntax=docker/dockerfile:1.3
2
- FROM continuumio/miniconda3:4.12.0@sha256:58b1c7df8d69655ffec017ede784a075e3c2e9feff0fc50ef65300fc75aa45ae
2
+ # FROM continuumio/miniconda3:4.12.0@sha256:58b1c7df8d69655ffec017ede784a075e3c2e9feff0fc50ef65300fc75aa45ae
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
3
5
4
6
ENV NB_USER jovyan
5
7
ENV NB_UID 1000
@@ -11,6 +13,7 @@ ENV R_LIBS_USER /opt/r
11
13
12
14
# Explicitly add littler to PATH
13
15
# See https://github.com/conda-forge/r-littler-feedstock/issues/6
16
+ # 11/14/2024: The littler path appears to be solved already
14
17
ENV PATH ${CONDA_DIR}/lib/R/library/littler/bin:${CONDA_DIR}/bin:$PATH
15
18
16
19
# Output logging faster
@@ -38,8 +41,12 @@ RUN --mount=type=cache,id=ohw_r_apt,target=/var/cache/apt \
38
41
locales \
39
42
psmisc \
40
43
sudo \
44
+ # 11/14/24: should this lib version be udpated?
41
45
libapparmor1 \
46
+ libfmt-dev \
47
+ # 11/14/24: should this lib version be udpated?
42
48
libpq5 \
49
+ libssl-dev \
43
50
lsb-release \
44
51
ca-certificates \
45
52
libclang-dev > /dev/null \
@@ -51,8 +58,16 @@ RUN echo "${LC_ALL} UTF-8" > /etc/locale.gen && \
51
58
52
59
# # Set path where R packages are installed
53
60
# # Download and install rstudio manually
61
+ # 11/13/2024: (using $ cat /etc/os-release) 2i2c hub currently runs on Ubuntu jammy (22), not bionic (18).
62
+ # Drilling down to jammy at https://posit.co/download/rstudio-server/, it looks like the latest rstudio-server deb is:
63
+ ENV RSTUDIO_URL https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2024.09.1-394-amd64.deb
64
+
65
+ # 11/19/2024: Tried Ubuntu focal (20). It didn't make a difference
66
+ # ENV RSTUDIO_URL https://download2.rstudio.org/server/focal/amd64/rstudio-server-2024.09.1-394-amd64.deb
67
+
68
+ # # (11/13/2024: The comment below is at from 2022 or earlier)
54
69
# # Newer one has bug that doesn't work with jupyter-rsession-proxy
55
- ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.deb
70
+ # ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.deb
56
71
# ENV RSTUDIO_URL https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.5042-amd64.deb
57
72
RUN curl --silent --location --fail ${RSTUDIO_URL} > /tmp/rstudio.deb && \
58
73
dpkg -i /tmp/rstudio.deb && \
@@ -65,9 +80,13 @@ USER ${USER}
65
80
66
81
COPY ./conda-linux-64.lock /tmp/
67
82
68
- RUN --mount=type=cache,id=ohw_r,target=/opt/conda/pkgs,uid=${NB_UID},gid=${NB_UID} \
83
+ RUN --mount=type=cache,id=ohw_r,target=${CONDA_DIR}/pkgs,uid=${NB_UID},gid=${NB_UID} \
84
+ # https://github.com/jupyterhub/jupyterhub-deploy-docker/issues/91#issuecomment-525563836
85
+ # To avoid libmamba and libarchive channel conflicts, make sure conda-forge is the only channel
86
+ # https://github.com/conda/conda-libmamba-solver/issues/283#issuecomment-1949560105
87
+ conda config --add channels conda-forge && \
88
+ conda update --all && \
69
89
conda install --name ${CONDA_ENV} --file /tmp/conda-linux-64.lock && \
70
- # micromamba install --name ${CONDA_ENV} --file environment.yml && \
71
90
find -name '*.a' -delete && \
72
91
# rm -rf /opt/conda/conda-meta && \
73
92
rm -rf ${CONDA_DIR}/include && \
@@ -79,9 +98,10 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
79
98
# 2024-10-10: Have there been improvements in install_cran and install_github such that
80
99
# dependencies, upgrade_dependencies, upgrade could now be set to TRUE or the default?
81
100
# RUN installGithub.R BigelowLab/rasf BigelowLab/ohwobpg # not working on GH but works locally :-/
82
- RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
83
- Rscript -e "remotes::install_cran('forecast', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
84
- Rscript -e "remotes::install_cran('ggspatial', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
101
+ RUN \
102
+ # -- Dependencies to the target packages, not already installed via the conda environment
103
+ Rscript -e "remotes::install_cran('PBSmapping', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
104
+ # -- Target packages
85
105
Rscript -e "remotes::install_cran('plot.matrix', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
86
106
Rscript -e "remotes::install_cran('isdparser', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
87
107
Rscript -e "remotes::install_cran('geonames', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
@@ -101,16 +121,17 @@ RUN Rscript -e "remotes::install_cran('assertthat', dependencies=FALSE, upgrade_
101
121
Rscript -e "remotes::install_github('hvillalo/echogram', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
102
122
Rscript -e "remotes::install_github('hvillalo/periods', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
103
123
Rscript -e "remotes::install_github('hvillalo/satin', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
104
- Rscript -e "remotes::install_github('kwstat/pals', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)" && \
105
124
Rscript -e "remotes::install_github('JorGarMol/VoCC', dependencies=FALSE, upgrade_dependencies=FALSE, upgrade=FALSE)"
106
125
107
126
COPY CONDARC ./.condarc
108
- COPY Rprofile.site /opt/conda /lib/R/etc/
127
+ COPY Rprofile.site ${CONDA_DIR} /lib/R/etc/
109
128
110
129
ENV PATH /usr/lib/rstudio-server/bin/:${PATH}
111
130
112
131
ENV LD_LIBRARY_PATH=${CONDA_DIR}/lib
113
132
114
133
# USER root
115
134
# RUN chown -R jovyan ${CONDA_DIR}
135
+ # https://github.com/oceanhackweek/jupyter-image/pull/97#issuecomment-2488105625
136
+ RUN chown -R ${NB_USER} ${HOME}/.cache
116
137
USER ${NB_USER}
0 commit comments