Cidree / rpostgis

rpostgis: R Interface to a 'PostGIS' Database
http://cidree.github.io/rpostgis/
77 stars 14 forks source link

Problem to install version 1.4.3 rpostgis in docker #34

Closed agronomofiorentini closed 5 months ago

agronomofiorentini commented 5 months ago

I have got a problem in order to install the following dockerfile

FROM rocker/geospatial:latest
RUN apt-get update && apt-get install -y curl gdal-bin git-core imagemagick libcurl4-openssl-dev libfontconfig1-dev libgdal-dev libgeos-dev libgeos++-dev libgit2-dev libicu-dev libjq-dev libpng-dev libpq-dev libproj-dev libprotobuf-dev libsasl2-dev libssl-dev libudunits2-dev libv8-dev libxml2-dev make pandoc pandoc-citeproc protobuf-compiler libprotoc-dev zlib1g-dev && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y \
        python3-pip \
        gdal-bin \
        aria2 \
        libpython2-dev && \
    apt autoremove -y && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt ./requirements.txt
RUN pip3 install segment-geospatial 
RUN pip3 install groundingdino-py
RUN pip3 install leafmap
RUN pip3 install localtileserver
RUN pip3 install numpy --upgrade --ignore-installed

RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" >> /usr/local/lib/R/etc/Rprofile.site
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("jsonlite",upgrade="never", version = "1.8.4")'
RUN Rscript -e 'remotes::install_version("DBI",upgrade="never", version = "1.1.3")'
RUN Rscript -e 'remotes::install_version("sp",upgrade="never", version = "1.5-1")'
RUN Rscript -e 'remotes::install_version("readxl",upgrade="never", version = "1.4.1")'
RUN Rscript -e 'remotes::install_version("rgeos",upgrade="never", version = "0.6-1")'
RUN Rscript -e 'remotes::install_version("raster",upgrade="never", version = "3.6-11")'
RUN Rscript -e 'remotes::install_version("RPostgreSQL",upgrade="never", version = "0.7-4")'
RUN Rscript -e 'remotes::install_version("tidyverse",upgrade="never", version = "1.3.2")'
RUN Rscript -e 'remotes::install_version("sf",upgrade="never", version = "1.0-9")'
RUN Rscript -e 'remotes::install_version("Rook",upgrade="never", version = "1.2")'
RUN Rscript -e 'remotes::install_version("rgdal",upgrade="never", version = "1.6-3")'
RUN Rscript -e 'remotes::install_version("rapidoc",upgrade="never", version = "8.4.3")'
RUN Rscript -e 'remotes::install_version("plumber",upgrade="never", version = "1.2.1")'
RUN Rscript -e 'remotes::install_version("NbClust",upgrade="never", version = "3.0.1")'
RUN Rscript -e 'remotes::install_version("future",upgrade="never", version = "1.30.0")'
RUN Rscript -e 'remotes::install_version("data.table",upgrade="never", version = "1.14.6")'
RUN Rscript -e 'remotes::install_version("nasapower",upgrade="never", version = "4.0.8")'
RUN Rscript -e 'remotes::install_version("owmr",upgrade="never", version = "0.8.2")'
RUN Rscript -e 'remotes::install_version("RPostgres",upgrade="never", version = "1.4.4")'
RUN Rscript -e 'remotes::install_version("httr",upgrade="never", version = "1.4.4")'
RUN Rscript -e "remotes::install_github('ranghetti/sen2r', dependencies = TRUE)"
RUN Rscript -e 'remotes::install_version("lubridate",upgrade="never", version = "1.9.0")'
RUN Rscript -e 'remotes::install_version("shinyjs",upgrade="never", version = "2.1.0")'
RUN Rscript -e 'remotes::install_version("promises",upgrade="never", version = "1.2.0.1")'
RUN Rscript -e 'remotes::install_version("SPEI",upgrade="never", version = "1.7")'
#RUN Rscript -e 'remotes::install_version("mapview",upgrade="never", version = "2.11.0")'
RUN Rscript -e 'install.packages("emayili")'
RUN Rscript -e 'install.packages("rsi")'
RUN Rscript -e 'install.packages("geojsonsf")'
RUN Rscript -e 'install.packages("RColorBrewer")'
RUN Rscript -e 'install.packages("echarts4r")'
RUN Rscript -e 'install.packages("base64enc")'
RUN Rscript -e 'install.packages("reshape2")'
RUN Rscript -e 'install.packages("soilDB")'
RUN Rscript -e 'install.packages("reticulate")'
RUN Rscript -e 'remotes::install_github("bevingtona/planetR@e9a895d51a962bb35dda3ebf25fb9112199c22ca")'
RUN Rscript -e 'remotes::install_github("MichelNivard/gptstudio@055558509abdc7140ea9801140753be49e436d05")'
RUN Rscript -e 'remotes::install_version("leaflet.extras2",upgrade="never", version = "1.2.0")'
RUN Rscript -e 'remotes::install_version("pollen",upgrade="never", version = "0.82.0")'
RUN Rscript -e 'remotes::install_version("agroclim",upgrade="never", version = "0.3.0")'
RUN Rscript -e 'remotes::install_version("timetk",upgrade="never", version = "2.8.2")'
RUN Rscript -e 'remotes::install_version("plotly",upgrade="never", version = "4.10.1")'
RUN Rscript -e 'remotes::install_version("tidymodels",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("randomForest",upgrade="never", version = "4.7-1.1")'
RUN Rscript -e 'remotes::install_version("ggplot2",upgrade="never", version = "3.4.3")'
RUN Rscript -e 'remotes::install_github("r-spatial/mapview@e0f2a41fc50f2c9dd28a111a92f96b9f59c141fe")'
RUN Rscript -e 'remotes::install_version("automap",upgrade="never", version = "1.1-9")'
RUN Rscript -e 'remotes::install_version("rmarkdown",upgrade="never", version = "2.26")'
RUN Rscript -e 'remotes::install_version("leaflet.extras",upgrade="never", version = "1.0.0")'
RUN Rscript -e 'remotes::install_version("DT",upgrade="never", version = "0.26")'
#RUN Rscript -e 'remotes::install_version("rpostgis",upgrade="never", version = "1.4.3")'
#RUN Rscript -e 'utils::install.packages("rpostgis_1.3.0.tar.gz", repos = NULL, type="source")'
RUN Rscript -e 'remotes::install_version("rpostgis", version = "1.4.3", repos = "http://cran.us.r-project.org")'

# Create the user's files and settings, set runtime dependencies
RUN sudo -u rstudio mkdir /home/rstudio/.sen2r && \
    sudo -u rstudio R -e 'sen2r::load_binpaths(c("aria2", "gdal"))' && \
    sudo -u rstudio mkdir /home/rstudio/sen2cor && \
    sudo -u rstudio mkdir /home/rstudio/sen2cor/sen2cor_255 && \
    sudo -u rstudio R -e 'sen2r::install_sen2cor("/home/rstudio/sen2cor/sen2cor_255", version = "2.5.5")' && \
    sudo -u rstudio R -e 'tmp <- sen2r::s2_tiles()'

RUN echo "root:ciaociaociao+" | chpasswd

RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone

EXPOSE 587/tcp
EXPOSE 3000

ENTRYPOINT ["R", "-e", "library(plumber);library(reticulate);library(soilDB);library(echarts4r);library(base64enc);library(reshape2);library(sen2r);library(mapview);library(RColorBrewer);library(SPEI);library(lubridate);library(shinyjs);library(geojsonsf);library(promises);library(emayili);library(owmr);library(nasapower);library(gptstudio);library(data.table);library(raster);library(RPostgreSQL);library(sf);library(rpostgis);library(Rook);library(rgdal);library(rapidoc);library(NbClust);library(future);library(planetR);library(jsonlite);library(rgeos);library(DBI);library(sp);library(readxl);library(tidyverse);library(automap);library(rmarkdown);library(leaflet.extras);library(DT);plumb('run_plumber.R')$run(port=3000, host='0.0.0.0')"]

when i run docker run rpostgisproblem

rpostgis does not exist but I see in the log when creating the image that it correctly installs the package.

What can i do to overpass this problem

agronomofiorentini commented 5 months ago

I have find the problem, it was related to the version of rpostgis