[root@mymachine redisc]# docker run -p 6379:6379 --user myuser redisc
docker: Error response from daemon: linux spec user: unable to find user myuser: no matching entries in passwd file.
but i can become myuser on the host
[root@mymachine redisc]# sudo su myuser
[myuser@mymachine redisc]#
How would i be able to run as myuser in the container?
According to the documentation you can use the ID of the user / group:
When passing a numeric ID, the user does not have to exist in the container.
Source: https://docs.docker.com/engine/reference/run/#user
The command could look like this:
docker run -p 6379:6379 --user 1001 redisc
The host and the container are completely separate. You need to create myuser
inside the redisc container before you try and run stuff as that user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With