Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI - gitlab-runner run as root

I new on continous integration on iOS, I try to run build with gitlab-runner and use shell as executor but I got issue that pod cannot run as root I am sure that I am not installing cocoapods with sudo and I try run whoami at before_script and that's right my runner run as root enter image description here

any one got same issue ?and how to fix it ?

like image 875
alpiopio Avatar asked Feb 27 '18 09:02

alpiopio


1 Answers

Register the runner without sudo, and that should set the gitlab-runner to run as your current user.

So steps should be:

sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64

sudo chmod +x /usr/local/bin/gitlab-runner

gitlab-runner register ...

gitlab-runner install

Remember to stop your sudo gitlab-runner service otherwise you could have multiple runners on the same machine fighting for the same jobs.

like image 74
Rekovni Avatar answered Sep 24 '22 21:09

Rekovni