Hi Docker Gurus,
I have seeing a weird problem when creating a docker image. I have the following RUN instruction in my Dockerfile:
RUN addgroup -S ubuntu && \
adduser -S -D ubuntu -h /home/ubuntu -s /bin/bash -G ubuntu && \
addgroup ubuntu root
But when I use the docker image in a Concourse CICD, the user ubuntu has only one group:
bash-5.0$ id
uid=101(ubuntu) gid=102(ubuntu) groups=102(ubuntu)
But in the container, when I use su command to login as ubuntu again, all the groups are as expected for ubuntu.
bash-5.0$ sudo su - ubuntu
ACMv1-: id
uid=101(ubuntu) gid=102(ubuntu) groups=102(ubuntu),0(root)
I expected the root and ubuntu groups to be associated with the user ubuntu even before trying su command. Appreciate any help in this matter.