Search code examples
dockergitlab-cigitlab-ci-runnervps

"ERROR: Preparation failed: missing docker configuration" on private gitlab runner (executor: docker)


I'm trying to run gitlab runner on my VPS. I followed instructions from gitlab manual (https://docs.gitlab.com/runner/register/), but when I try to run a job in my gitlab project I'm getting following error in job logs:

Preparing the "docker" executor
00:09
ERROR: Preparation failed: missing docker configuration
Will be retried in 3s ...
ERROR: Preparation failed: missing docker configuration
Will be retried in 3s ...
ERROR: Preparation failed: missing docker configuration
Will be retried in 3s ...
ERROR: Job failed (system failure): missing docker configuration

Here is config from config.toml on my vps:

concurrent = 1
check_interval = 0
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "furmanus"
  url = "https://gitlab.com"
  id = <id_here>
  token = "<token_here>"
  token_obtained_at = <obtain_date>
  token_expires_at = <expiry_date>
  executor = "docker"
  [runner.docker]
    tls_verify = false
    image = "gitlab/gitlab-runner:latest"
    priviledged = false
    disable_cache = false
    volumes = ["/cache"]
    pull_policy = "if-not-present"
    cache_dir = "/cache/gitlab"

User gitlab-runner on my VPS have access to both docker and runner config file (when I log on this user I can execute docker commands and read file located at /etc/gitlab-runner/config.toml). My project is using this example .gitlab-ci.yml file:

image: node:18-alpine

stages:
  - install
  - build

install:
  stage: install
  tags:
    - furmanus
  script:
    - npm install
  cache:
    key:
      files:
        - package.json
        - package-lock.json
    paths:
      - node_modules
    policy: push

build:
  stage: build
  tags:
    - furmanus
  dependencies:
    - install
  script:
    - echo "install"

What am I missing?


Solution

  • You have [runner.docker] in your config, while it rather should be [runners.docker], according to the docs.