Page 1 of 1

Docker Command for non root files

Posted: 17 Jun 2017, 21:38
by river
I just used docker and it is great, only issue with it when filebot moves file, user and group will changed to root; so normal user does not have access to it.

I spend time on google and found solution for this

trick is give read write access to folder mapped using :rw and setting appropriate UID and GID variable
here is sample code

Code: Select all

docker run -it \
-v /path/to/input/folder:/path/to/input/folder:rw \
-v /path/to/output/folder:/path/to/output/folder:rw \
-v /path/to/log/folder:/path/to/log/folder:rw \
-v /path/to/name/formate/folder:/path/to/name/formate/folder:rw \
-v path/to/exclude/list/folder:path/to/exclude/list/folder:rw \
-v /path/to/external/script/folder:/path/to/external/script/folder:rw \
-v $PWD:/volume1 \
-v data:/data \
-e USER_ID=1000 -e GROUP_ID=1000 rednoah/filebot \
-script fn:amc /path/to/input/folder/file  \
--log-file /path/to/log/filebot-$DATE-.log -r \
--output /path/to/output/folder \
--db TheTVDB --action keeplink -non-strict --conflict skip  \
--def @/path/to/name/formate/folder/filebot_tv_formate \
ut_kind="multi" excludeList="path/to/exclude/list/folder/tv_excludes_list" \
plex="127.0.0.1:"$PlexToken"" \
exec="bash /path/to/external/script/folder/script.sh \"{n}\" \"{s00e00}\" \"{t}\" \"{hd}\" \"{source}\" \"{vc}\" \"{group}\" \"{folder}\""
USER_ID and GROUP_ID can be found using

Code: Select all

id -u 
and

Code: Select all

id -g
, so replace 1000 with appropriate number.
my log, name formate file, exclude list and script are in folder so instead 4 different folder I mapped only 1 folder.
I do not know signification of -v $PWD:/volume1 -v data:/data so I kept as it is as rednoah suggested on docker hub page.

Re: Docker Command for non root files

Posted: 22 Aug 2017, 00:38
by whocares
if that not work (like it did for me) because docker normally runs as root, it's possbile to use

Code: Select all

docker run --user <username>... 
or even

Code: Select all

docker run --user <userID> ....