Local runner ignores default image in .gitlab-ci.yml
Summary
Running GitLab locally and by hand can't find the image
-parameter specified in the default
segment of the configuration. Moving the image
-parameter to the top scope solves the issue. Another workaround is to use --docker-image
.
Using image
in the top scope is deprecated according to the documentation.
Steps to reproduce
On MacOS install the runner with brew and start a job.
$ brew install gitlab-runner
$ gitlab-runner exec docker test-phpcs
.gitlab-ci.yml
default:
image: php:7.1-cli-stretch
stages:
- test
test-phpcs:
stage: test
except:
- tags
- master
before_script:
- curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
- curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
script:
- php phpcs.phar --error-severity=1 --warning-severity=8 --standard=PSR1,PSR2 --ignore=./vendor/* --extensions=php ./app
allow_failure: true
Actual behavior
It can't find the default image I have specified.
Expected behavior
I expect the job to run.
Relevant logs and/or screenshots
Running with gitlab-runner 12.1.0 (de7731dd)
ERROR: Preparation failed: No Docker image specified to run the build in
Environment description
- arch=amd64
- os=darwin
- revision=de7731dd
- version=12.1.0