Can the Dockerfile be modified to use the PUID and GUID from compose.yaml environment? #3880
Replies: 2 comments 3 replies
-
|
And if this isn't important to you, just tell me. I'd be happy to dig in, fix this, and submit a pull request. I just figured you could do this about a zillion times faster than I could. :D |
Beta Was this translation helpful? Give feedback.
-
|
I'm a little confused why you're talking about PUID and PGID when the variables should be UID and GID: Using the compose file: services:
mc:
image: itzg/minecraft-server
environment:
EULA: true
UID: 1002
GID: 1002
volumes:
- data:/data
volumes:
data:The startup shows that it is accessing
That's all in docker's hands and it does indeed do that already. The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
First.... Thanks for this! It's awesome! :D
Ok. Here's my problem: The containerized server is writing to the data folder as UID and GID 1000. But I don't use that account to do all my Minecraft stuff. I used UID/GUI 1002 (a user called "minecraft", see my compose.yaml file below). So all the files in the data folder are being set to a user I don't use, and I have to CHOWN the files all the time, which is annoying.
This is a normal Docker problem, usually we can get around it by setting a UID and GID to use in the compose.yaml file. Here's mine for reference...
Setting the PUID and PGID in the environment key should, in theory, be used by the containerized process so it can run stuff and make files as that user/group.
But that's not happening, and I think it's because you're specifying pid/gid 1000 in the Dockerfile?
Line 67 in your Dockerfile...
It's not a BIG deal, but could you change it so your Thing respects the environment variables set in the compose.yaml file when it runs?
Sorry if I'm totally wrong here or way off base. Apologies for not digging in and submitting a pull request. I have kids. I'm tired... :D
Thanks again! Your server setup Thing is enabling me to play minecraft with my kiddos on our own server without random internet weirdos!
:D
Tony
Beta Was this translation helpful? Give feedback.
All reactions