docker-workflow-plugin
docker-workflow-plugin copied to clipboard
JENKINS-45473 Run user inside with all groups membership.
Adds all groups using --group-add.
When using docker.inside() or a Docker agent, --user is passed to assume the Jenkins user's identity, but this only works for the user id and primary group id. This patch adds all additional groups (by id) the user may belong to.
The primary motivation is the lack of membership in the "docker" group inside the agent, which makes running docker commands not possible without some kind of dirty workaround.