DOCKER_SOCKET=/var/run/docker.sock
DOCKER_GROUP=docker
JENKINS_USER=jenkins
if [ -S ${DOCKER_SOCKET} ]; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCKET})
sudo groupadd -for -g ${DOCKER_GID} ${DOCKER_GROUP}
sudo usermod -aG ${DOCKER_GROUP} ${JENKINS_USER}
fi
# Restart Jenkins service
sudo service jenkins restart
Created
November 11, 2017 17:05
-
-
Save AjeetK/dff33e592e9e44497cc040920dd862b5 to your computer and use it in GitHub Desktop.
Adding jenkins User To Docker Group
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment