When I use gitlab-runner to build docker image, it report error like this “unix /var/run/docker.sock: connect: permission denied”
It because when we run with gitlab-runner, it will use user named gitlab-runner to run, you can find it with this command
1 | cut -d : -f 1 /etc/passwd |
But user gitlab-runner it not own docker group, we can use this command to join the docker group
1 | sudo gpasswd -a gitlab-runner docker |
OK, it will be resolved, enjoy it.