I am trying to start a docker from inside of a docker container. I am currently trying to run with the following args
“–group-add docker -u 1001:1001 -v /var/run/docker.sock:/var/run/docker.sock -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group”
But I am getting permission issues because the socket is owned by root and docker group. The user belongs to the docker group but when using “–group-add docker” it will for some reason add docker group as 999 which is not matching the docker group that the user 1001 belongs which is 127. I am trying to run this on multiple jenkins nodes so I cannot hardcode the --group-add to 127. I am having some issues with setting this dynamically in jenkins right now. So my question is what is the best approach from docker point of view to have this working?
I appreciate any pointers