<p>The short answer is "it depends". Rancher itself runs using system-docker and the docker instances it starts for you, such as gitlab-runner are run separately in regular docker. Gitlab-runner then will start runners depending on <em>its</em> configuration: </p>

<blockquote>
  <p>There are three methods to enable the use of... docker run during
  jobs; each with their own tradeoffs.</p>
</blockquote>

<p><a href="https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#runner-configuration" rel="nofollow noreferrer">https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#runner-configuration</a></p>

<p><strong>My eventual solution</strong></p>

<p>I'd initially installed Rancher 1.6 and just <a href="https://github.com/rancher/rancher/issues/13662" rel="nofollow noreferrer">couldn't get the dependencies working</a> (Rancher OS running Rancher 1.6 and Rancher agent running on a couple of Alpine nodes). </p>

<p>The upgrade to Rancher v2 was a steep learning curve as you need to learn the Kubernetes ecosystem tooling (helm, kubectl, etc). I still couldn't get a gitlab-runner working under Rancher v2, but <strong>upgrading to v2.0.8 fixed it</strong>. I could add the custom helm chart for gitlab-runner and after cribbing the settings from <a href="https://gitlab.com/charts/gitlab-runner/blob/master/values.yaml" rel="nofollow noreferrer">https://gitlab.com/charts/gitlab-runner/blob/master/values.yaml</a> I could get gitlab-runner working under Rancher v2.</p>

CC BY-SA 4.0
2018-09-18T11:37:35.823Z
2018-09-18T11:37:35.823Z
jaygooby
<p>I’ve got an AWS gitlab instance successfully doing CI with gitlab-runners running under vagrant on my local dev machine. I’d like to move the runners off my machine and onto a standalone server...</p>

<p>I’ve put Rancher on a box and can get the gitlab runner installed, but I can’t get my head around how to not do docker-in-docker, or whether this actually matters. </p>

<p>My understanding is that unless I do <code>_some_configuration_I_don’t_know_</code> that Rancher runs the gitlab-runner as a Docker container, and the gitlab runner will in turn start a docker container inside itself to run my CI test environment as specified in the <code>.gitlab-ci.yml</code></p>

<p>Is there a way to get the gitlab-runner to tell Rancher to start the CI test environment instead?</p>

<docker><gitlab><rancher>
Rancher & gitlab-runner - is there a way to get the gitlab-runner to tell Rancher to start the CI test environment instead?
jaygooby
# Rancher & gitlab-runner - is there a way to get the gitlab-runner to tell Rancher to start the CI test environment instead?

(Asked by: username_0 on 2018-05-04)

I’ve got an AWS gitlab instance successfully doing CI with gitlab-runners running under vagrant on my local dev machine. I’d like to move the runners off my machine and onto a standalone server...

I’ve put Rancher on a box and can get the gitlab runner installed, but I can’t get my head around how to not do docker-in-docker, or whether this actually matters.

My understanding is that unless I do `_some_configuration_I_don’t_know_` that Rancher runs the gitlab-runner as a Docker container, and the gitlab runner will in turn start a docker container inside itself to run my CI test environment as specified in the `.gitlab-ci.yml`

Is there a way to get the gitlab-runner to tell Rancher to start the CI test environment instead?

**Tags:** docker, gitlab, rancher


---

## 1 answers

### Answer by username_0 on 2018-09-18. Score: 1

The short answer is "it depends". Rancher itself runs using system-docker and the docker instances it starts for you, such as gitlab-runner are run separately in regular docker. Gitlab-runner then will start runners depending on *its* configuration:

> There are three methods to enable the use of... docker run during
> jobs; each with their own tradeoffs.

<https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#runner-configuration>

**My eventual solution**

I'd initially installed Rancher 1.6 and just [couldn't get the dependencies working](https://github.com/rancher/rancher/issues/13662) (Rancher OS running Rancher 1.6 and Rancher agent running on a couple of Alpine nodes).

The upgrade to Rancher v2 was a steep learning curve as you need to learn the Kubernetes ecosystem tooling (helm, kubectl, etc). I still couldn't get a gitlab-runner working under Rancher v2, but **upgrading to v2.0.8 fixed it**. I could add the custom helm chart for gitlab-runner and after cribbing the settings from <https://gitlab.com/charts/gitlab-runner/blob/master/values.yaml> I could get gitlab-runner working under Rancher v2.


---

