Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature to make gitlab-runner member of docker group #17

Open
LongLiveCHIEF opened this issue Aug 19, 2018 · 1 comment
Open

Add a feature to make gitlab-runner member of docker group #17

LongLiveCHIEF opened this issue Aug 19, 2018 · 1 comment

Comments

@LongLiveCHIEF
Copy link
Contributor

Migrated from voxpupuli/puppet-gitlab#150, originally opened by @gdubicki


Pleae make this module optionally do step 4. from https://docs.gitlab.com/ce/ci/docker/using_docker_build.html#use-shell-executor in case you want to use the runner for building Docker images.

You can do it with a hacky-but-working:

exec {'add gitlab-runner to docker group':
    command => '/sbin/usermod -aG docker gitlab-runner',
    unless  => '/bin/grep -q "docker\\S*gitlab-runner" /etc/group',
}
@logicminds
Copy link
Contributor

I recently setup a new runner with docker and the step you provided above was not needed and all the jobs ran successfully. I suspect this is the case because when the gitlab-runner service is running it runs as root which has docker privileges. However, the scripts themselves are run as a different user defined like: gitlab-runner run --user gitlab-runner. So I am not sure this is really needed.

gitlab-runner run --help
Runtime platform                                    arch=amd64 os=darwin pid=7005 revision=ac8e767a version=12.6.0
NAME:
   gitlab-runner run - run multi runner service

USAGE:
   gitlab-runner run [command options] [arguments...]

OPTIONS:
   -c value, --config value             Config file (default: "/Users/cosman/.gitlab-runner/config.toml") [$CONFIG_FILE]
   --listen-address value               Metrics / pprof server listening address [$LISTEN_ADDRESS]
   -n value, --service value            Use different names for different services (default: "gitlab-runner")
   -d value, --working-directory value  Specify custom working directory
   -u value, --user value               Use specific user to execute shell scripts
   --syslog                             Log to system service logger [$LOG_SYSLOG]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants