Sorry, @cmardonespino. I meant id
instead of whoami
to check the groups.
I've been able to reproduce this issue: running id
as user jenkins
from the command line returns:
uid=1001(jenkins) gid=1003(jenkins) groups=1003(jenkins),999(docker)
However, running it in the pipeline, it returns this instead:
uid=1001(jenkins) gid=0(root) groups=0(root)
This explains why it's not able to run docker
commands. I'll forward this to another team so they can continue investigating this.
In the meantime, I can provide you with a different workaround, which is changing the group of /var/run/docker.sock
to root
:
sudo chgrp root /var/run/docker.sock
@carey, please confirm that you are able to replicate this post. If that's not the case, please open a new ticket for your case.
Regards,
Alejandro