How can I install R packages in newest version of R 4.2.3 image while building the image through docker file

327 Views Asked by At

I am trying to update and rebuild my RStudio image on centos with the docker file. Initially I was using R-3.6.0 which I am planning to update to R-4.3.1

Updated code snippet

RUN yum install -y java-1.8.0-openjdk-devel \
                   R-4.3.1 \    # Updated this line from R-3.6.0
                   devtoolset-8 --nogpgcheck && \
    yum install -y cmake3 \
                   ImageMagick-c++-devel \
                   proj \
                   proj-devel \
                   epel-release \
                   v8-devel

RUN echo /opt/R/4.3.1/bin/R --version && \
    chmod -R 755 /usr/lib64/R && \
    yum install -y /tmp/Rpackages/rstudio-server-rhel-2023.06.1-524-x86_64.rpm && \

# Install R packages
RUN /usr/bin/R CMD INSTALL /tmp/Rpackages/yaImpute_1.0-33.tar.gz        && \ -- This line throws  an error 
#    /usr/bin/R CMD INSTALL /tmp/Rpackages/ALEPlot_1.1.tar.gz            && \

After updating the R version in the above code While installing R packages it throws below error.

#0 0.260 /bin/sh: /usr/bin/R: No such file or directory

What path should I pass while installing packages on line RUN /usr/bin/R CMD INSTALL /tmp/Rpackages/yaImpute_1.0-33.tar.gz ? Previously above code used to work for older version of R. is there any update in the path that I should mentioned?

0

There are 0 best solutions below