Why does the "id" command in Linux show the same group twice? [closed]

  docker, linux, superuser

For some reason as I was exploring Linux users and groups, the id command on a user I created in an Alpine container gives the following:

# id botmyaccount
uid=10001(botmyaccount) gid=10001(botmyaccount) groups=10001(botmyaccount),10001(botmyaccount)

which is confusing to me because it seems there is a duplicate of the botmyaccount (same name as the created user) group in the groups list. What’s going on? Is it something involving supplementary vs primary groups of a user, though I thought that distinction was already made between the "gid" and "groups" lists?

The botmyaccount group only appears in a single entry within /etc/group/. This is all after running:

addgroup botmyaccount -g 10001
adduser botmyaccount -u 10001 -G botmyaccount

Source: Docker Questions

LEAVE A COMMENT