Question:
I’ve recently converted my Docker installation to rootless mode. While I managed to fix most issues. After the conversion, I noticed that NFS mounts no longer work in docker-compose
, so I moved them to fstab
. Additionally, I faced several directory permission errors.
I encountered a perplexing problem with directory permissions when mapping host directories to containers.
Setup:
- Host Directory:
/docker/enshrouded
- Container Directory:
/home/enshrouded/savegame
- Mapping Command:
docker run -v /docker/enshrouded:/home/enshrouded/savegame
Problem:
I use Steam game images where the ‘steam user’ inside the Docker container is mapped to UID and GID 10000. Despite changing the ownership of the host directory with chown -R 10000:10000
, I kept getting permission errors.
To troubleshoot, I created a directory with chmod 777
and logged into the container to check file ownership. Surprisingly, the ownership was set to 109999.
Question:
Is there a better way to understand and manage the UID/GID offset in rootless Docker? I’ve read various resources, but none provide a clear, deterministic method. I actually tried 10001, 20000, but didn’t occur to me to calculate 109999. Perhaps I am dense. Not sure if alternative toolkits like Podman are going to be much better here or not. Either way I feel like rootless was probably the right move but this is the last hurdle to revamping fungibility of my home server.
Reference:
Experimenting with Rootless Docker
[Docker Container] (https://github.com/jsknnr/enshrouded-server)
I actually tried 10001, 20000, but didn’t occur to me to calculate 109999. I read https://medium.com/@tonistiigi/experimenting-with-rootless-docker-416c9ad8c0d6 . I expected a calculable method.
Obiwantoby is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.