Hi everybody,
my hope is to reference the necessary files and folders or copy them on an R image to use GRASS functions in R.
I have a Docker file like the following:
FROM neteler/grassgis7 as thegrass
FROM rocker/rstudio
COPY --from=thegrass /usr/local/grass79 /usr/local/grass79
COPY --from=thegrass /data /data
COPY --from=thegrass /home/grass /home/grass
RUN sudo apt-get install -y libcurl4-openssl-dev libxml2-dev
Then I build and run the image which has a few folders from GRASS GIS
In RStudio, I install and call the “rgrass7” and “raster” libraries. (No errors)
Then in Rstudio, I try to run the initGRASS function with the following values:
initGRASS(gisBase = "/usr/local/grass79", home = raster::tmpDir(), gisDbase = "tmpDbase", location = "Kitchener", mapset = "PERMANENT", override = TRUE)
This is the error I recieve:
Error in parseGRASS(cmd, legacyExec = legacyExec) : The command
g.region --interface-description
could not be run (127), and produced the error message:
g.region: error while loading shared libraries: libproj.so.12: cannot open shared object file: No such file or directory
In addition: Warning message:
In system2(command = command, args = arguments, stdout = outFile, :
error in running command
Do you know a better way to merge the GRASS GIS files with the R image?
Would you please help me to complete the Dockerfile to avoid such errors?