docker-library/repo-info

New container files has wrong file owner, group

Smyl3 opened this issue · 3 comments

Smyl3 commented

Hi,
If I create a new mosquitto container with volumes, all the volumes directory and files owner and group turns to id 1883 even without a port binding parameter in docker run command.

UID 1883 is what Mosquitto runs as in the container

$ docker run -d --rm --name mosquitto eclipse-mosquitto
4af1d7e4a8faed69f92e7d8cca111375cf58a22aaf3a06a498b14fcce3d57cd7

$ docker exec -it mosquitto sh
/ # cat /etc/passwd | grep mosquitto
mosquitto:x:1883:1883:mosquitto:/var/empty:/sbin/nologin

/ # ps aux
PID   USER     TIME  COMMAND
    1 mosquitt  0:00 /usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf
    9 root      0:00 sh
   17 root      0:00 ps aux

Going to close since we don't maintain that image ourselves
https://hub.docker.com/_/eclipse-mosquitto

Maintained by: the Eclipse Foundation
Where to get help: the Docker Community Forums, Docker Community Slack, or Stack Overflow

Where to file issues: https://github.com/eclipse/mosquitto/issues

Smyl3 commented

Thanks the fast reply. I will open a ticket over there. PUID, PGID docker run parameters even dont work at all with mosqitto.

If you want to run an image as a different user than the one the image developers created it with, I'd suggest --user (which changes the UID/GID before the container even starts, unlike any environment variable would be able to do).