Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: docker: Error response from daemon: linux spec user: unable to find user myuser: no matching entries in passwd file

Tags:

[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?

like image 870
ealeon Avatar asked Jan 29 '18 17:01

ealeon


2 Answers

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
like image 57
Mathias Avatar answered Sep 19 '22 13:09

Mathias


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.

like image 24
Adam Taylor Avatar answered Sep 19 '22 13:09

Adam Taylor