3 ms·
So what is the right way to configure Docker such that both the container and my host user can alter files in the volume?
by dotancohen 6y ago
So what is the right way to configure Docker such that both the container and my host user can alter files in the volume?
- kortex 6y agoHoping to get a good answer via Cunningham's law here: the way I currently do it is to create a shared GID on the host, add the docker user to that same number GID (via build args), and chmod it appropriately. chmod -R 2775 on folder to be shared seems to do the trick. This is probably wrong and lazy. I think the rigorous approach is to use namespaces https://www.jujens.eu/posts/en/2017/Jul/02/docker-userns-remap/ https://www.jujens.eu/posts/en/2017/Jul/02/docker-userns-rem...
- pvtmert 6y agodocker daemon has a id remap option called userns-remap https://www.objectif-libre.com/en/blog/2020/06/30/securiser-docker-au-travers-de-la-fonctionnalite-userns-remap/ https://www.objectif-libre.com/en/blog/2020/06/30/securiser-...
- cpuguy83 6y agoThis is actually worse because the filesystem does not know about user namespaces.