Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to find user root: no matching entries in passwd file

Tags:

docker

I have a running Docker container with the following:

docker exec -it cc58908a8dc2 /bin/bash

I ran this command before on other containers and it worked just fine. Now, however, I'm getting this issue:

unable to find user root: no matching entries in passwd file

My Dockerfile has the following contents:

# We will be running our Spark jobs as `root` user.
USER root

# Working directory is set to the home folder of `root` user.
WORKDIR /root

Any idea of what could cause this?

like image 972
octavian Avatar asked Jan 13 '17 14:01

octavian


1 Answers

Sometimes, after restarting the Docker container that message appears.

If instead of restarting like this: docker restart cc58908a8dc2

I stopped and started the container like this:

docker stop cc58908a8dc2
docker start cc58908a8dc2

Then the error disappeared.

like image 133
octavian Avatar answered Sep 21 '22 18:09

octavian