0

Problem Summary I'm running a GitLab CI pipeline with a Kubernetes runner that uses Docker-in-Docker (privileged mode). When I try to mount a volume from the GitLab Runner's filesystem into a Docker container, the files exist on the host but are not accessible inside the container. Environment GitLab Runner: Kubernetes executor with privileged mode Docker: Running in privileged container with Docker socket mounted GitLab Runner Config:

config: |
 [[runners]]
 id = 0
 output_limit = 100000
 [runners.kubernetes]
 namespace = "{{.Release.Namespace}}"
 image_pull_secrets = ["my-registry-secret"]
 memory_request = "1048Mi"
 cpu_request = "500m"
 logs_section_max_size = 52428800 # 50 MB
 timeout = 3600
 privileged = true
 helper_cpu_request = "500m"
 helper_memory_request = "168Mi"
 helper_image = "docker.io/gitlab/gitlab-runner-helper:x86_64-v17.0.0"
 pull_policy = "if-not-present"
 image = "xxxxxxxxxxxxxx"
 # Enable shared storage for docker in docker
 builds_dir = "/builds"
 cache_dir = "/cache" 
 [runners.kubernetes.volumes]
 [[runners.kubernetes.volumes.host_path]]
 name = "docker"
 mount_path = "/var/run/docker.sock"
 read_only = false
 host_path = "/var/run/docker.sock"
 [[runners.kubernetes.volumes.host_path]]
 name = "cache"
 mount_path = "/cache"
 read_only = false
 host_path = "/tmp/cache"
 [[runners.kubernetes.volumes.host_path]]
 name = "builds"
 mount_path = "/builds"
 read_only = false
 host_path = "/tmp/gitlab-runner/builds"
 [[runners.kubernetes.volumes.host_path]]
 name = "runner-secrets"
 mount_path = "/etc/gitlab-runner/certs"
 read_only = true
 host_path = "/etc/ssl/certs"

Current Code

container_monorepo_path = "/workspace"
 docker_command = (
 f'docker run --rm '
 f'-v {monorepo_root}:{container_monorepo_path} '
 f'-w {container_monorepo_path}/{relative_project_path} '
 f'--user root '
 f'private-registry.company.com/docker-adv-all/docker-agent-playwright '
 f'sh -c "'
 f'npm config set strict-ssl false && '
 f'npm install -g pnpm nx && '
 f'pnpm nx run {project_name}:{task}"'
 )

Actual Error Output

[2025年07月11日 22:24:36] - [INFO]: running command => docker run --rm -v /builds/t3_zrKwM/0/550016304/cp-monorepo:/workspace -w /workspace/packages/frontend/actions --user root private-registry.company.com/docker-agent-playwright:latest sh -c "npm config set strict-ssl false && npm install -g pnpm nx && pnpm nx run actions:test-component"
[2025年07月11日 22:24:46] - [INFO]: added 125 packages in 9s
[2025年07月11日 22:24:46] - [INFO]: 28 packages are looking for funding
[2025年07月11日 22:24:46] - [INFO]: run `npm fund` for details
[2025年07月11日 22:24:46] - [ERROR]: npm notice
[2025年07月11日 22:24:46] - [ERROR]: npm notice New major version of npm available! 9.5.1 -> 11.4.2
[2025年07月11日 22:24:46] - [ERROR]: npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.4.2>
[2025年07月11日 22:24:46] - [ERROR]: npm notice Run `npm install -g [email protected]` to update!
[2025年07月11日 22:24:46] - [ERROR]: npm notice
[2025年07月11日 22:24:46] - [INFO]: ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND No package.json (or package.yaml, or package.json5) was found in "/workspace/packages/frontend/actions".
[2025年07月11日 22:24:47] - [ERROR]: ❌ test-component failed
asked Jul 11, 2025 at 22:41

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.