CM2Walki / steamcmd

Minimal image containing Valve's SteamCMD binary: https://hub.docker.com/r/cm2network/steamcmd/

Home Page:https://CM2.Network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PUID hardcoded?

lowfuel opened this issue · comments

Hi, I can't seem to get this to use my provided ENV for PUID. It always sets itself to 1000 no matter what environment variable I pass in when creating the container.

Could this be changed so that the env is used, instead of hardcoding it?
Same goes for GUID probably.

PUID is not an environment variable (ENV), it's a build argument (ARG). Since the user is created at build time (baked into the image), changing the userid at runtime of the container is not possible. See:

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

Added via PR #5 for context

If you want to change the PUID, you will need to rebuild the image from scratch (either adjusting the PUID in the Dockerfile or passing "--build-arg PUID=[YourPUID]" to docker build)

I hope that clears things up.

Fair enough, but FWIW other Dockers I use (including didstopia's satisfactory server) allow env's for user and group so they can be changed at run time. I don't know enough about Docker to know if that's a best practice, or why some have it and some don't, but it really helps when running on a NAS with mounted volumes so the permissions all work.

Appreciate your reply very much! Cheers.