With the current implementation sanity checks will fail when running the docker container as an arbitrary user (e.g. with user: 1001:1001 in docker-compose.yml):
config.go:91: user: unknown userid 1001
This happens because the os/user implementation of Current() (see a similar issue) tries to obtain the user info based on /etc/passwd file and entry in it is not created when running a container with a specific UID:GID.
This PR changes it so UID is printed instead of the username, thus fixing the issue.
On a sidenote, we can try to get the username and fallback to printing just the user id. I am not sure if it's cleaner than going straight to the user IDs though.
This resolves https://github.com/anatol/pacoloco/issues/99
With the current implementation sanity checks will fail when running the docker container as an arbitrary user (e.g. with
user: 1001:1001
indocker-compose.yml
):This happens because the
os/user
implementation ofCurrent()
(see a similar issue) tries to obtain the user info based on/etc/passwd
file and entry in it is not created when running a container with a specific UID:GID.This PR changes it so UID is printed instead of the username, thus fixing the issue.
On a sidenote, we can try to get the username and fallback to printing just the user id. I am not sure if it's cleaner than going straight to the user IDs though.