Reputation: 961
A CI/CD pipeline is setup in the gitlab with runner on Ubuntu 18.04, with shell executor. When executing docker commands from the pipeline scripts permission denied error is being thrown.
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
Already added the gitlab-runner
user to the root group still the issue is not resolved.
gitlab-runner
is already running as root
user also.
root 4534 0.5 2.2 36908 23060 ? Ssl 14:02 0:02 /usr/lib/gitlab-runner/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner
Any help to resolve this is greatly appreciated
Figured out the answer
usermod -aG docker gitlab-runner
sudo service docker restart
Upvotes: 3
Views: 4909
Reputation: 961
How to resolve this issue:
usermod -aG docker gitlab-runner
sudo service docker restart
Upvotes: 5