I'm using docker some time and I like the conception very much. But I found a thing is a big problem for me.
I'm talking about permissions. While I'm not worrying about production, setting up my docker development environment becomes hell, because of file ownerships and permissions. For example:
- www-data user from php container cannot create files in my directories (www-data uid is 82 while my uid is 1000) I was trying to change www-data id to 1000 but I share this environment with macOS users, who typically have uid of 500
- I cannot remove files that have been created within container - that makes it hard for me to jump between git branches sometimes (
sudo rm somefile).
I spend hours, no, days looking for ultimate solution. Tried
gosu in containers, mounting
/etc/shadow as a volume etc. The problem is, I was unable to find a solution that can be considered multi-platform and proper (mounting local system files readonly just doesn't look good).