3 ms·
Hack to "solve" Rootless Docker permission issues: nsenter -U --preserve-credentials -n -m -t $(cat $XDG_RUNTIME_DIR/docker.pid) /usr/bin/chown -R root:root
by geenat 5y ago
Hack to "solve" Rootless Docker permission issues:
nsenter -U --preserve-credentials -n -m -t $(cat $XDG_RUNTIME_DIR/docker.pid) /usr/bin/chown -R root:root /home/user/workspace
This one liner enters the namespace of Rootless Docker, and does the chown back to your normal user (root is your host user when you switch back).
Useful anytime you use a filesystem mount ... (Ex: storing database on disk so docker doesn't kill it every run).
You can now do backups, rebuild docker images, etc.
More information: https://github.com/jpetazzo/nsenter#how-do-i-use-nsenter https://github.com/jpetazzo/nsenter#how-do-i-use-nsenter