From 1c8a6c27d0cec56fd1acf76fef91ea2a398b2d7b Mon Sep 17 00:00:00 2001 From: Lextuga007 Date: Sat, 15 Jun 2024 09:19:04 +0100 Subject: [PATCH] Changed to https://stackoverflow.com/questions/78249680/i-can-not-load-sf-in-docker --- Dockerfile | 61 +++++------------------------------------------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e40604..e54c9ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,15 +2,6 @@ FROM rocker/r-ubuntu:22.04 ADD Rprofile.site /usr/lib/R/etc/Rprofile.site -# https://github.com/jlacko/RCzechia/blob/master/data-raw/Dockerfile -# for GDAL use -RUN apt-get update && apt-get -y install libexpat-dev - -# for GEOS use -RUN apt-get update && apt-get -y install libsqlite3-dev - -# the big three - cruel & unusual versions from source (takes about forever; should be on top of the dockerfile) - RUN apt-get update \ && apt-get upgrade -y @@ -18,57 +9,15 @@ RUN wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.4.550/qua && DEBIAN_FRONTEND=noninteractive apt install ./quarto-*-linux-amd64.deb \ && rm quarto-*-linux-amd64.deb +RUN apt-get update && \ + apt-get install -y libproj22 libudunits2-0 libgdal30 && \ + rm -rf /var/lib/apt/lists/* +RUN R -e "install.packages('sf')" + RUN apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN R -q -e 'install.packages("remotes"); remotes::install_github("rundel/checklist")' -# PROJ -RUN cd \ - && wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz \ - && tar zxvf proj-4.9.3.tar.gz \ - && cd proj-4.9.3/ \ - && ./configure \ - && make -j $(nproc) \ - && make install - -# GDAL -RUN cd \ - && wget http://download.osgeo.org/gdal/2.2.3/gdal-2.2.3.tar.gz \ - && tar zxvf gdal-2.2.3.tar.gz \ - && cd gdal-2.2.3 \ - && ./configure \ - && make -j $(nproc) \ - && make install - -# GEOS -RUN cd \ - && wget http://download.osgeo.org/geos/geos-3.6.2.tar.bz2 \ - && bunzip2 geos-3.6.2.tar.bz2 \ - && tar xvf geos-3.6.2.tar \ - && cd geos-3.6.2 \ - && ./configure \ - && make -j $(nproc)\ - && make install - -# other required packages; standard versions suffice... -# absolutely positively required on a single line (bo update a instal must be in the same keš) -RUN apt-get update && apt-get -y install libudunits2-dev -RUN apt-get update && apt-get -y install libxml2-dev -RUN apt-get update && apt-get -y install libv8-dev -RUN apt-get update && apt-get -y install libjq-dev -RUN apt-get update && apt-get -y install libprotobuf-dev -RUN apt-get update && apt-get -y install protobuf-compiler -RUN apt-get update && apt-get -y install libxtst6 -RUN apt-get update && apt-get -y install libfontconfig1-dev -RUN apt-get update && apt-get -y install libharfbuzz-dev -RUN apt-get update && apt-get -y install libfribidi-dev -RUN apt-get update && apt-get -y install libfreetype6-dev -RUN apt-get update && apt-get -y install libpng-dev -RUN apt-get update && apt-get -y install libtiff5-dev -RUN apt-get update && apt-get -y install libjpeg-dev -RUN ldconfig - - CMD ["bash"]