GitLab-CI: Cannot link to a non running container

前端 未结 1 1003
北荒
北荒 2021-02-05 12:12

I\'ve tried to get my setup work with gitlab-ci. I have a simple gitlab-ci.yml file

build_ubuntu:
  image: ubuntu:14.04
  services:
    - rikorose/gcc-cmake:gcc-         


        
相关标签:
1条回答
  • 2021-02-05 12:45

    You must start the gitlab-runner container with

    --privileged true
    

    but that is not enough. Any runner containers that are spun up by gitlab after registering need to be privileged too. So you need to mount the gitlab-runner

    docker exec -it runner /bin/bash
    nano /etc/gitlab-runner/config.toml
    

    and change privileged flag from false into true:

    privileged = true
    

    That will solve the problem!

    note: you can also mount the config.toml as a volume on the container then you won't have to log into the container to change privileged to true because you can preconfigure the container before running it.

    0 讨论(0)
提交回复
热议问题