From 27bd1fc5384886bb2db70e30e98c001d956515d5 Mon Sep 17 00:00:00 2001
From: nd <git@notandy.de>
Date: Fri, 24 Dec 2021 20:42:59 +0100
Subject: [PATCH] add workaround to docker env

---
 tasks/main.yml           | 2 --
 templates/config.toml.j2 | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index e86b5d6..85c1ac6 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -56,7 +56,6 @@
     - runner_is_registered.rc == 1
   command:
     "gitlab-runner register --non-interactive --url {{ gitlab_runner.url }} --registration-token {{ gitlab_runner.token }} --executor docker --docker-image '{{ gitlab_runner.image }}' --description '{{ gitlab_runner.description }}'"
-
 # We really don’t want to use this, but there is no other way: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1539
 - name: set concurrency for gitlab-runner
   lineinfile:
@@ -65,4 +64,3 @@
     line: "concurrent = {{ gitlab_runner.concurrent }}"
   notify:
     - restart gitlab-runner
-
diff --git a/templates/config.toml.j2 b/templates/config.toml.j2
index 1a9ffe9..8c34dad 100644
--- a/templates/config.toml.j2
+++ b/templates/config.toml.j2
@@ -4,3 +4,6 @@ listen_address = "[::1]:9252"
 
 [session_server]
   session_timeout = 1800
+[[runners]]
+  # Workaround to fix container detection in docker, see https://github.com/GoogleContainerTools/kaniko/issues/1542#issuecomment-999545027
+  environment = ["container=docker"]
-- 
GitLab