0

Inside a docker container, if I type groups it works and gives 'root' in the result but when I type groups <username> it says groups: '<username>': no such user. What is the reason for this behavior?

7
  • Command groups without supplying user argument returns the groups to which the current user belongs. In your case the root group. It appears that the username you supplied in call with username does not exist. Commented Jan 29, 2020 at 22:20
  • Thanks for your reply. where is the <username> supposed to exist for the docker container to recognize and not give that error? Commented Jan 29, 2020 at 22:28
  • The command users returns the list of available users in your system. Commented Jan 29, 2020 at 22:32
  • from my dev system, i am able to run groups <teammate'sldap> and get the results. And when i ran 'users' on that system it resulted just my name. so how do i get similar behavior on my docker instance? i need to be able to run groups <anyldapname> and get the results. Thanks! Commented Jan 29, 2020 at 22:39
  • Does your container have LDAP configured? Commented Jan 29, 2020 at 22:49

1 Answer 1

0

To get your locally configured groups (and users) into the container, you would mount /etc/passwd and /etc/groups into it.

In your case there is LDAP involved. You should add information how it is integrated on your host. You could have a look if your LDAP integration syncs into the /etc/groups and /etc/passwd files on your host.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.