1

I want to run Gitlab CI Runner in a docker container while also using the docker executor to run my builds in their own docker containers, all of that on top of CoreOS.

Is this even possible? Every documentation I've found so far assumes that Gitlab Runner is running on the host OS which is not a viable option for me.

The alternative would be to have specialised gitlab-runner containers with the build dependencies installed in each one.

1

There is --privileged parameter

https://docs.docker.com/engine/reference/run/#/runtime-privilege-and-linux-capabilities

Which should give capability to run docker inside docker. So theoretically it possible, but you probably run into other problems.

0

You need to mount docker.sock , set --privileged

docker run -d  -v /var/run/docker.sock:/var/run/docker.sock --name gitlab-runner --privileged --restart always -v d:/docker/data/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner:latest

And set config privileged .

[[runners]]

  name = "docker2"
  url = "https://gitlab.com/"
  token = "xxxxx"
  executor = "docker"
  [runners.docker]
    image = "alpine:latest"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    shm_size = 0

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.