-
Hi! Newbie here. (Really neat app btw Jesse!) I run a NAS 24x7 (Unraid) and would prefer to host ytdl-sub there via Docker so that I can automate it over time. My problem is when I create files via the container, the default owner and permissions are such that I receive errors when I try to move/delete/rename using smb, connecting as my preferred username of josh. I understand this is down to PUID/PGID/UMASK. The challenge is they look correct. Here's my work, do you spy what I'm missing? Docker creating files as: root Example files and folders created from either Samba or the container:
This is after setting PUID=1000, PGID=100 and UMASK=000. (I cannot tell UMASK doing anything and am guessing it is setting the user side, not root?) At least when I query umask from within the container I get the default 0022:
I can see the proper variable values are being passed as desired:
Here's the output of id:
While I have other docker applications running, I have never attempted to create files on the NAS from a container itself. From research I am only 80% confident that I would expect the docker created files to be owned by username=josh, group=users and with a mask of 666 (since I am setting a umask of 000). Am I wrong on expected behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The docker container uses the username |
Beta Was this translation helpful? Give feedback.
-
I'm running the ubuntu docker image on a Synology NAS. Before I ran build docker_ubuntu to create the image, I edited Dockerfile.ubuntu by adding the following Below ARG DEBIAN_FRONTEND=noninteractiveChange this to match the existing user details on your NASARG USERNAME=ytdl Below the existing RUN command in the dockerfileRUN useradd --uid $USER_UID --gid $USER_GID -M $USERNAME Below HOME="/config"USER ytdl Below VOLUME /configVOLUME /video Now your container will run under container user ytdl and access the host filesystems with host user ytdl. Anything new created in /video /music etc will be owned by user ytdl You can also do this if you use the alpine image,, but note that the adduser command has different syntax on alpine and will need to be changed accordingly |
Beta Was this translation helpful? Give feedback.
The docker container uses the username
abc
, which should be 1000:100. When you log into the container, you need to dodocker exec -u abc ytdl-sub /bin/bash
, otherwise you log in as root and it will create files using the root user