Closed nick-youngblut closed 3 months ago
Maybe https://rocker-project.org/images/versioned/rstudio.html#userid-and-groupid?
The UID and GID of the default non-root user can be changed as follows:
docker run --rm -ti -e USERID=1001 -e GROUPID=1001 -p 8787:8787 rocker/rstudio
Warning If these are set, ownership of the /home/rstudio directory in the container is updated by the root user. This will also overwrite the ownership of any files that are bind-mounted under the /home/rstudio directory.
@eitsupi how is that different from:
-e USERID=$(id -u) \
-e GROUPID=$(id -g) \
...which I'm already using?
There is no difference. I think that by setting them, additional behavior is occurring, causing a malfunction. Perhaps that means you shouldn't mount the bind under the home directory.
@nick-youngblut How about using /mnt
in the container, too?
What is the reason for explicitly mounting within /home/rstudio
?
@benz0li that solution works. Thanks!
What is the reason for explicitly mounting within
For users with less computational skills, presenting all mounted directories in /home/rstudio
is easier for them than /mnt
, which is not (easily) shown in the Rstudio file browser.
@nick-youngblut I think this has come up many times here before, so please feel free to search past issues. When one runs RStudio it keeps state below $HOME which is in conflict with mounting that directory read-only.
For users with less computational skills, presenting all mounted directories in
/home/rstudio
is easier for them than/mnt
, which is not (easily) shown in the Rstudio file browser.
@nick-youngblut You could conditionally symlink ~/mnt
to /mnt
by adding something like
if [ "$(ls -A /mnt 2>/dev/null)" != "" ]; then
runuser -u "${USER}" -g "$(id "${USER}" -g -n)" -- ln -snf /mnt "${USERHOME}"/mnt
fi
Container image name
rocker/rstudio:4.3.1
Container image digest
No response
What operating system related to this question?
Linux
System information
Question
I would like to mount my working directory and also a NAS directory mounted on the VM that I'm using (
/mnt/NAS/
).My docker run command:
When I include
-v /mnt/NAS/LabDevices/NGS-210-21:/home/rstudio/NGS-210-21
, theinit
command seems to fail (but no error message written to the console), and I cannot access the Rstudio login screen; however, I can access the login if that NAS mount point is not included.I can mount
/mnt/NAS/LabDevices/NGS-210-21
for other docker containers, so this appears specific to the setup ofinit
inrocker/rstudio:4.3.1
. I don't see any docs on dealing with mounting read-only directoriesrocker/rstudio
.Any ideas on what the problem is?