mtoensing / Docker-Minecraft-PaperMC-Server

Starts a Minecraft PaperMC server
https://hub.docker.com/r/marctv/minecraft-papermc-server
MIT License
246 stars 92 forks source link

Update to run as non-root. #23

Closed j4c3 closed 3 years ago

mtoensing commented 3 years ago

I'll test this on the beta branch. Thanks https://github.com/mtoensing/Docker-Minecraft-PaperMC-Server/tree/beta

j4c3 commented 3 years ago

Cool. Hopefully it doesn't mess with anything else in there for you. You'd mentioned putting the user in the Dockerfile, but I think to make it portable, it has to be pushed back to where users can define environmental variables to pass the ids.

mtoensing commented 3 years ago
Screen Shot 2021-04-16 at 21 11 15

So this changes the ownership to 9001:9001 of every file on the local storage, correct? Why is this better? I think this is because of this, isn't it: https://github.com/mtoensing/Docker-Minecraft-PaperMC-Server/commit/5425142fb70f973ddd026f3b370519988946beef#diff-79738685a656fe6b25061bb14181442210b599f746faeaba408a2401de45038aR15

Can you please explain to me why this is a good idea?

j4c3 commented 3 years ago

If you've run it without the PUID/PGID variables, it sets them to that as a default, so as to not give them permissions with some user/group that may already exist on the host system.

mtoensing commented 3 years ago

Thank you!