How to configure a custom Dockerfile and run it locally?

OK, I was able to proceed by executing the command in a terminal inside the docker container, but the permissions still trip me up, because I cannot install anything inside the container. For example I get an error message that the following folder is not writable:

s -al /layers/paketo-buildpacks_conda-env-update/conda-env/lib/R/
total 116
drwxr-xr-x  10 renku_build cnb  4096 Jan  1  1980 .
drwxr-xr-x  32 renku_build cnb 53248 Jan  1  1980 ..
-rw-r--r--   1 renku_build cnb 18011 Jan  1  1980 COPYING
-rw-r--r--   1 renku_build cnb    46 Jan  1  1980 SVN-REVISION
drwxr-xr-x   3 renku_build cnb  4096 Jan  1  1980 bin
drwxr-xr-x   4 renku_build cnb  4096 Jan  1  1980 doc
drwxr-xr-x   2 renku_build cnb  4096 Jan  1  1980 etc
drwxr-xr-x   3 renku_build cnb  4096 Jan  1  1980 include
drwxr-xr-x   2 renku_build cnb  4096 Jan  1  1980 lib
drwxr-xr-x 113 renku_build cnb  4096 Jan  1  1980 library
drwxr-xr-x   2 renku_build cnb  4096 Jan  1  1980 modules
drwxr-xr-x  11 renku_build cnb  4096 Jan  1  1980 share
 workspace ❯ host ❯ notebooks ▶ docker1 ▶ 1✎ ▶ 2⚑ ▶ $ ▶ whoami
renku

So the owner of the files is renku_build, but the user is renku. I tried running the container as user renku_build, but this led to other errors. Do you have an idea how to solve this?

Have you tried just running the container locally as the root user rather than renku_build? Then you will have permissions to do anything inside the container. On renku we run with user and group id 1000. You can try that too.

Thanks, but passing --user root to docker run prevents jupyter from starting, and --user 1000 still results in the same permissions problem.

Hi @schymans - if you need to just install packages once you are in the session, you can use one of the global environments we provide - either the one using renku/renkulab-r image or one of the rocker images. In the upcoming release we will include an option to automatically build images with R and R packages as well (similar to how it is done now with python).

Thanks, Rok, but to make sure that my local docker container behaves similarly to the one on renkulab, I think that running the respective docker image, as proposed by you and @tolevski above would be ideal. There must be a way of fixing the permissions inside the session. Any more ideas?