Open ColinFay opened 3 years ago
Not sure it will be enough for all.
RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone
# Add option to warn and stop
RUN R -e 'options(warn = 2);remotes::install_local(upgrade="never")'
RUN rm -rf /build_zone
Docker continues...
Same with Rscript
Step 46/52 : RUN Rscript -e 'options(warn = 2);remotes::install_local(upgrade="never")'
---> Running in 09e43edd13e4
Error : Could not copy `/build_zone` to `/tmp/Rtmpv66clL/file771f45e69`
Removing intermediate container 09e43edd13e4
---> 1653bab57384
Step 47/52 : RUN rm -rf /build_zone
---> Running in 4ad3b57dfd3a
Well, my error is already an error. Do not have to convert warning to error... But this error does not lead to stop building container
Maybe you can use this at the beginning of the Dockerfile:
# Transform warns as errors
RUN echo "options(warn = 2);" >> $R_HOME/etc/Rprofile.site
Then set back by removing the last line
# Remove option to warn and stop
RUN head -n -1 $R_HOME/etc/Rprofile.site
# or this one if you are not sure other lines are added during the installation process
RUN echo "options(warn = -1);" >> $R_HOME/etc/Rprofile.site
remotes::install will not make the Dockerfile fail if there is an error. options(warn = 2) solves that.
vs