CM2Walki / CSGO

Dockerfile for automated build of a CS:GO gameserver: https://hub.docker.com/r/cm2network/csgo/
https://CM2.Network
MIT License
249 stars 74 forks source link

Volume owner and group #82

Closed tapir closed 1 year ago

tapir commented 2 years ago

After switching to a new host I've re-ran this image and the csgo data volume files and folders are owned by "ubuntu:ubuntu". I thought it was "steam:steam" before. Interestingly my host system doesn't have any user or group called ubuntu so it does steam from the image itself somehow.

In any case, either it's steam or ubuntu, I don't have permission to touch any files because my user in the host system is neither ubuntu nor steam. Any workarounds for that?

CM2Walki commented 2 years ago

This behavior is inherited from the steamcmd base image, where the unprivileged container user is generated using user Id (UID) 1000:

https://github.com/CM2Walki/steamcmd/blob/master/bullseye/Dockerfile#L7

Try setting the permissions to 1000:1000:

chown 1000:1000 [bind mount location]

Are you sure you don't have a ubuntu user? That's usually what causes this behavior on my end.

Alternatively, you can rebuild the steamcmd base image yourself with a userID that's higher to avoid such a conflict. I can't adjust the value anymore as it would break people's setups.