Docker Task Driver New User

Hi team,

I’m new to Nomad. How could we create a new user inside Docker container spawned up by Nomad? We don’t want to run our Nomad task as root, so I specified User: "nomad" field in Task config. However, we are seeing below error

API error (500): unable to find user nomad: no matching entries in passwd file

We have tried passed in “useradd -ms /bin/bash nomad” as Command field to docker config, which is later passed in to Config field of Nomad Task, but it didn’t work. Could someone help us with this? Thanks!

Hi @yiliny10, if you aren’t using docker daemon’s user namespace remapping, then the behavior is to run as the specified user of the host system