EugenMayer / docker-sync

Run your application at full speed while syncing your code for development, finally empowering you to utilize docker for development under OSX/Windows/*Linux
GNU General Public License v3.0
3.54k stars 290 forks source link

Files in app container owned by unexpected user (ID 33) #797

Closed younkim closed 2 years ago

younkim commented 2 years ago

As title says. I have a Docker Compose setup that runs the app as root (ID 0). When I use Docker Sync, it starts writing to its app_sync directory as xfs with ID 33. This makes the file on my app container owned by www-data because it has user ID 33, making my app break due to write permission issues. Strange enough, files in host_sync are owned by root.

I've tried configuring sync_userid: 0 because both my app container and Docker Sync root have ID 0. However, this doesn't change anything. Files are still writing as xfs in app_sync and as root in host_sync. I've tried restarting, syncing, and cleaning.

I thought my app container should get ownership of host_sync's permission, but it appears to get app_sync's directly for some reason. Any idea what I'm configuring wrong?

To sum it up, file ownership are like this:

EugenMayer commented 2 years ago

Please share your docker-sync.yml and which strategy you are using / which OS