How to get R's install.packages to error out in a Dockerfile? -


below command failed, docker kept going. i'm pretty sure because 'warning' ("installation had non-zero exit code") wasn't passed outward non-zero exit code rscript invocation.

how can stop docker build?

step 21/44 : run rscript -e 'install.packages("https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz", dependencies=true)'  ---> running in 26ba0c1da37c installing package ‘/usr/local/spark-1.6.1-bin-hadoop2.6/r/lib’ (as ‘lib’ unspecified) inferring 'repos = null' 'pkgs' trying url 'https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz' content type 'application/x-gzip' length 75619 bytes (73 kb) ================================================== downloaded 73 kb  error: dependencies ‘extradistr’, ‘rstan’ not available package ‘prophet’ * removing ‘/usr/local/spark-1.6.1-bin-hadoop2.6/r/lib/prophet’ warning message: in install.packages("https://cran.rstudio.com/src/contrib/prophet_0.1.tar.gz",  :   installation of package ‘/tmp/rtmpaa2xqv/downloaded_packages/prophet_0.1.tar.gz’ had non-zero exit status 

you can force warnings treated errors (i.e., immediate "stop") setting options(warn = 2). ?options:

 'warn': sets handling of warning messages.  if 'warn'       negative warnings ignored.  if 'warn' 0 (the       default) warnings stored until top-level function       returns.  if 10 or fewer warnings signalled       printed otherwise message saying how many signalled.       object called 'last.warning' created , can printed       through function 'warnings'.  if 'warn' one, warnings       printed occur.  if 'warn' 2 or larger       warnings turned errors. 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -