You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually not an issue but a finding that might be nice to write in the documentation.
I managed to use rclone-mount with a specific user id and group id via docker. It's a bit of a hack but it works.
docker run \
... default options like environment variables and volume mounts
-e MountCommands="--cache-dir /rclone-cache ... a lot more mount commands" \
-v /etc/passwd:/etc/passwd:ro \
-v /home/somebody/rclone-cache:/rclone-cache \
-u $(id -u):$(id -g) \
mumiehub/rclone-mount
The user id and group id are set via the Docker --user/-u argument. I used $(id -u) and $(id -g) in order to get the user id and group id of the logged in user. Any other id can also be provided. This user most likely doesn't exist inside the container. That means that this user only has an id and not a name. Rclone/fuse need a username in order to function properly:
staticconstchar*get_user_name(void)
{
structpasswd*pw=getpwuid(getuid());
if (pw!=NULL&&pw->pw_name!=NULL)
returnpw->pw_name;
else {
fprintf(stderr, "%s: could not determine username\n", progname);
returnNULL;
}
}
By mounting the local /etc/passwd file into the container (as read only) the user name becomes available.
The second problem is that Rclone is no longer able to write cache to the default cache directory. Because it has insufficient permissions. By explicitly setting the --cache-dir /rclone-cache via the environment variable MountCommands the directory can be changed. Now it's possible to create a mount for the cache directory to make it possible to write here as the specified user.
This covers the TODO: launch with specific USER_ID.
The text was updated successfully, but these errors were encountered:
This is great, I would add that you need to update /etc/fuse.conf with user_allow_other in the container (I mounted my host fuse.conf read only) to enable running as another user.
This is actually not an issue but a finding that might be nice to write in the documentation.
I managed to use rclone-mount with a specific user id and group id via docker. It's a bit of a hack but it works.
The user id and group id are set via the Docker --user/-u argument. I used$(id -u) and $ (id -g) in order to get the user id and group id of the logged in user. Any other id can also be provided. This user most likely doesn't exist inside the container. That means that this user only has an id and not a name. Rclone/fuse need a username in order to function properly:
By mounting the local
/etc/passwd
file into the container (as read only) the user name becomes available.The second problem is that Rclone is no longer able to write cache to the default cache directory. Because it has insufficient permissions. By explicitly setting the
--cache-dir /rclone-cache
via the environment variableMountCommands
the directory can be changed. Now it's possible to create a mount for the cache directory to make it possible to write here as the specified user.This covers the TODO: launch with specific USER_ID.
The text was updated successfully, but these errors were encountered: