Skip to content

Commit 85e94e4

Browse files
committed
Dockerfile: install rgdal from archive
The rgdal package has been removed: https://cran.r-project.org/web/packages/rgdal/index.html so install it from the archive. Also install "pak", so the other packages could be installed in parallel which reduces the build time of the image.
1 parent 31fd098 commit 85e94e4

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

Dockerfile

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,31 +75,14 @@ pip3 install --no-cache-dir \
7575
git+https://github.com/ernstste/landsatlinks.git && \
7676
#
7777
# Install R packages
78-
Rscript -e 'install.packages("rmarkdown", repos="https://cloud.r-project.org")' && \
79-
Rscript -e 'install.packages("plotly", repos="https://cloud.r-project.org")' && \
80-
Rscript -e 'install.packages("stringi", repos="https://cloud.r-project.org")' && \
81-
Rscript -e 'install.packages("stringr", repos="https://cloud.r-project.org")' && \
82-
Rscript -e 'install.packages("tm", repos="https://cloud.r-project.org")' && \
83-
Rscript -e 'install.packages("knitr", repos="https://cloud.r-project.org")' && \
84-
Rscript -e 'install.packages("dplyr", repos="https://cloud.r-project.org")' && \
85-
Rscript -e 'install.packages("bib2df", repos="https://cloud.r-project.org")' && \
86-
Rscript -e 'install.packages("wordcloud", repos="https://cloud.r-project.org")' && \
87-
Rscript -e 'install.packages("wordcloud2", repos="https://cloud.r-project.org")' && \
88-
Rscript -e 'install.packages("network", repos="https://cloud.r-project.org")' && \
89-
Rscript -e 'install.packages("intergraph", repos="https://cloud.r-project.org")' && \
90-
Rscript -e 'install.packages("igraph", repos="https://cloud.r-project.org")' && \
91-
Rscript -e 'install.packages("htmlwidgets", repos="https://cloud.r-project.org")' && \
92-
Rscript -e 'install.packages("raster", repos="https://cloud.r-project.org")' && \
93-
Rscript -e 'install.packages("sp", repos="https://cloud.r-project.org")' && \
94-
Rscript -e 'install.packages("rgdal", repos="https://cloud.r-project.org")' && \
95-
Rscript -e 'install.packages("units", repos="https://cloud.r-project.org")' && \
96-
Rscript -e 'install.packages("sf", repos="https://cloud.r-project.org")' && \
97-
Rscript -e 'install.packages("snow", repos="https://cloud.r-project.org")' && \
98-
Rscript -e 'install.packages("snowfall", repos="https://cloud.r-project.org")' && \
99-
Rscript -e 'install.packages("getopt", repos="https://cloud.r-project.org")' && \
78+
Rscript -e "install.packages(c('sp', 'https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.6-7.tar.gz'), repos='https://cloud.r-project.org', Ncpus=4)" && \
79+
Rscript -e "install.packages('pak', repos='https://r-lib.github.io/p/pak/dev/')" && \
80+
CORES=$(nproc) && \
81+
export MAKEFLAGS="-j$CORES" && \
82+
Rscript -e "pak::pkg_install(c('rmarkdown','plotly', 'stringi', 'stringr', 'tm', 'knitr', 'dplyr', 'bib2df', 'wordcloud', 'wordcloud2', 'network', 'intergraph','igraph', 'htmlwidgets', 'raster', 'units', 'sf', 'snow', 'snowfall', 'getopt'))" && \
10083
#
10184
# Clear installation data
102-
apt-get clean && rm -r /var/cache/
85+
apt-get clean && rm -r /var/cache/ /root/.cache /tmp/Rtmp*
10386

10487
# Install folder
10588
ENV INSTALL_DIR /opt/install/src

0 commit comments

Comments
 (0)