Docker issue when building for R


It seems there are reccurring issues when building the docker image for a R environment :

“DockerBuildError: The command ‘/bin/sh -c r -e “cat /tmp/install.R”’ returned a non-zero code: 1”

There is probably something wrong with the packages, but I can’t figure it out. Could you help please ?

Also, is there a way to test locally with your environment specs ?

Finally, is it possible to use R packages not released by CRAN ?

Thank you

1 Like

Hi Macvot… good luck troubleshooting the docker submission approach.

I’m trying to get either of the colab notebook and zip file approach to work with something other than the trivial getting started notebooks at present; but I’m not having much success so far!

Most of my problems are of my own creation so far but once I do succeed I’ll share back for others.

1 Like

Hello @Macvot

The error you posted means that the dependency installation failed. For package installation, we execute the contents of install.R

Also, is there a way to test locally with your environment specs ?

You can specify one of the following in your config.json as a language

Language (in config.json) R version Corresponding docker image
r 4.0.3 aicrowd/r-base:4.0.3
r4 4.0.3 aicrowd/r-base:4.0.3
r4.0 4.0.3 aicrowd/r-base:4.0.3
r3 3.6.3 aicrowd/r-base:3.6.3
r3.6 3.6.3 aicrowd/r-base:3.6.3

We first run your install.R file and then run predict.R file.

If you are comfortable with docker and have it installed on your machine, you can do the following

docker run --rm -ti -v path_to_code_on_your_machine:/src aicrowd/r-base:4.0.3 bash
cd /src
r install.R
r predict.R

Finally, is it possible to use R packages not released by CRAN ?

We realized that devtools package was failing to install when submitted via colab notebooks. This is due to the missing dependencies in the upstream R base images. We added devtools package in our custom base image that we will be using from now. You can assume that you have devtools installed. So you can add require('devtools') and install from any source that you like. If you think there is anything that we need to add from our side to make things easier, please let us know.

If you are comfortable with docker, you can add your own Dockerfile in your submission and we will build the environment based on your Dockerfile.

Do feel free to reach out to us if you need any help with the submissions. You can post your queries here or reach out to us on discord,


Hello @Macvot

These packages will be pre-installed for R based submissions: Packages available in base environment for R

Let us know if you think we need to add any other package. :slight_smile: