rocker-org/rocker-versioned2#229
When using the docker image r-shiny:4.1.1
and installing some small apps which need to unzip some input files, I got stuck with permission denied on host-container shared volume using the shiny user.
Since I saw that this has also been a question with former docker images, I thought I post a possible solution here.
After playing around with various options, I provided the user-id and group-id for the shiny user in the image on built.
docker build -t r-shiny-nc:1.2 --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) .
docker build -t r-shiny-nc:1.2 .
The dockerfile snippet:
FROM r-ver:4.1.1
...
ARG USER_ID
ARG GROUP_ID
RUN addgroup --gid $GROUP_ID shiny
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID shiny
...
according to this source worked fine.
Docker run command:
docker run --rm --user shiny -d -p 3838:3838 -v /home/shiny/nc-shiny-apps/shiny-server/:/srv/shiny-server/ -v /home/shiny/nc-shiny-apps/shinylog/:/var/log/shiny-server/ r-shiny-nc:1.2