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
How to resolve this issue:
usermod -aG docker gitlab-runner
sudo service docker restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With