<p>I have problem with running docker in kubernetes runner.
I've installed kubernetes runner with helm and set privileged mode to true</p>
<pre><code>runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        namespace = &quot;{{.Release.Namespace}}&quot;
        image = &quot;ubuntu:20.04&quot;
        privileged = true
        allow_privilege_escalation = true 
</code></pre>
<p>I've created simple <code>.gitlab-ci.yaml</code> for test</p>
<pre><code>stages:
  - docker_test

services:
  - docker:dind

docker_test:
  stage: docker_test
  image: docker:latest
  variables:
      DOCKER_HOST: &quot;tcp://docker:2375&quot;
  script:
  - docker version
</code></pre>
<p>But when I fire this pipeline I'm gettint error</p>
<pre><code>Running with gitlab-runner 14.6.0 (5316d4ac)
  on gitlab-runner-gitlab-runner-5cc654bdf7-gjfvm augRojS5
Preparing the &quot;kubernetes&quot; executor
00:00
Using Kubernetes namespace: gitlab-runner
Using Kubernetes executor with image docker:latest ...
Using attach strategy to execute scripts...
Preparing environment
00:06
Waiting for pod gitlab-runner/runner-augrojs5-project-30333904-concurrent-0k66kk to be running, status is Pending
Waiting for pod gitlab-runner/runner-augrojs5-project-30333904-concurrent-0k66kk to be running, status is Pending
    ContainersNotReady: &quot;containers with unready status: [build helper svc-0]&quot;
    ContainersNotReady: &quot;containers with unready status: [build helper svc-0]&quot;
Running on runner-augrojs5-project-30333904-concurrent-0k66kk via gitlab-runner-gitlab-runner-5cc654bdf7-gjfvm...
Getting source from Git repository
00:03
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/gurita/gurita-core/.git/
Created fresh repository.
Checking out fe720f2f as main...
Skipping Git submodules setup
Executing &quot;step_script&quot; stage of the job script
00:00
$ docker version
Client:
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:40:57 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
</code></pre>
<p>I tried to set without variable but at this case there is no /var/run/docker.sock.</p>

nicram
<p>Thank you for your hint about mounting docker.sock.</p>
<p>this worked for me</p>
<pre><code>runners:
  config: |
    [[runners]]
      [runners.kubernetes]
        image = &quot;ubuntu:20.04&quot;
        privileged = true
      [[runners.kubernetes.volumes.empty_dir]]
        name = &quot;docker-emptydir&quot;
        mount_path = &quot;/var/run&quot;
        medium = &quot;Memory&quot;
</code></pre>
<p>Thanks again</p>
