Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
82 lines (69 loc) · 3.9 KB
/
Copy pathDockerfile
File metadata and controls
82 lines (69 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
FROM r-base:4.5.0
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV CXXFLAGS="-O2 -pipe -std=gnu++17"
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates gnupg apt-transport-https \
build-essential cmake g++ git wget make \
automake libtool autoconf pkg-config supervisor \
ninja-build zip unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
libproj-dev libgdal-dev libgeos-dev \
libnetcdf-dev libcurl4-openssl-dev libcpprest-dev \
libsqlite3-dev libboost-all-dev \
libsodium-dev libudunits2-dev libuv1-dev \
libfontconfig1-dev libfreetype6-dev libgit2-dev \
libgomp1 \
zlib1g-dev libunwind-dev libssl-dev libxml2-dev \
doxygen graphviz \
python3 python3-pip python3-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch 20230802.1 https://github.com/abseil/abseil-cpp.git /tmp/abseil && \
cmake -S /tmp/abseil -B /tmp/abseil/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DABSL_PROPAGATE_CXX_STD=ON \
-DABSL_ENABLE_INSTALL=ON && \
cmake --build /tmp/abseil/build -j"$(nproc)" && \
cmake --install /tmp/abseil/build && \
rm -rf /tmp/abseil
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
RUN R -e "install.packages(c('remotes'), repos='https://cloud.r-project.org')"
RUN R -e "options(warn=2, timeout=600); \
install.packages(c('plumber','useful','ids','R6','s2','sf','rstac','bfast','geojsonsf','clue'), repos='https://cloud.r-project.org'); \
missing <- c('plumber','useful','sf','rstac','clue'); \
if (length(missing <- missing[!sapply(missing, requireNamespace, quietly=TRUE)])) \
stop('Missing R packages after install: ', paste(missing, collapse=', '))"
# gdalcubes was archived on CRAN on 2026-09-16. Pin the upstream 0.7.5 release
# candidate (includes the filter_geom() segfault fix used by filter_spatial);
# switch back to CRAN once 0.7.5 is published there.
ARG GDALCUBES_REF=ed683314c2742d4f707bb5cddfc57c5e959765ef
RUN R -e "options(timeout=600, repos='https://cloud.r-project.org'); \
remotes::install_url('https://github.com/appelmar/gdalcubes/archive/${GDALCUBES_REF}.tar.gz', upgrade = 'never'); \
if (!requireNamespace('gdalcubes', quietly = TRUE) || packageVersion('gdalcubes') < '0.7.5') \
stop('gdalcubes ${GDALCUBES_REF} install failed')"
# Install missing required packages explicitly
# Note: stats and tools are base R packages, no need to install
RUN R -e "options(warn=2, timeout=600); \
install.packages(c('kernlab','readr','reticulate','xgboost','randomForest','terra','abind','tidyr','httr','caret','dplyr','base64enc','jsonlite','tibble','rlang'), repos='https://cloud.r-project.org')"
RUN R -e "options(timeout = 600, download.file.method = 'libcurl'); \
Sys.setenv(TORCH_INSTALL = '1'); \
install.packages('torch', repos = 'https://cloud.r-project.org'); \
library(torch); \
if (!torch_is_installed()) install_torch(restart_session = FALSE); \
if (!torch_is_installed()) stop('torch Lantern install failed'); \
t <- torch_tensor(1L); \
stopifnot(as.numeric(t) == 1L); \
message('Lantern OK')"
RUN mkdir -p /opt/dockerfiles/ /var/openeo/workspace/ /var/openeo/workspace/data/
COPY ./ /opt/dockerfiles/
RUN Rscript -e "options(warn=2, timeout = 600); \
message('Installing openeocubes package...'); \
remotes::install_local('/opt/dockerfiles', dependencies = FALSE, force = TRUE, verbose = TRUE); \
message('Checking if package is installed:'); \
if(!('openeocubes' %in% rownames(installed.packages()))) stop('openeocubes package not installed!')"
RUN R -e "message('.libPaths(): ', paste(.libPaths(), collapse=', ')); \
if(!requireNamespace('openeocubes', quietly = TRUE)) stop('openeocubes package not installed!')"
EXPOSE 8000
CMD ["R", "-q", "--no-save", "-f", "/opt/dockerfiles/startProduction.R"]