-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_instructions
27 lines (19 loc) · 1.1 KB
/
docker_instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
https://github.com/rocker-org/rocker-versioned2/issues/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](https://vsupalov.com/docker-shared-permissions/) 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`