GitLab CI 图片:高山 "apk: command not found" 错误

GitLab CI image: alpine "apk: command not found" error

我正在尝试在 GitLab CI 中关注 this tutorial to enable formatting checks using black

为了使事情更简单,我已将代码从 .lint-ci.yml 转移到 .gitlab-ci.yml。我正在使用的共享 运行ner 的标签是 gitlab-ci。当管道获得 运行:

时出现以下错误
bash: line 80: apk: command not found
ERROR: Job failed: exit status 1

显然,apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git 行会抛出该问题。

这是 .gitlab-ci.yml 文件:

formatter:
  stage: build
  tags:
    - gitlab-ci
  image: alpine
  only:
    - branches
  before_script:
    - apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git
    - pip install black
  script:
    - black . --check
  allow_failure: false

谁能帮我解决这个问题?

应@slauth 的要求,这里是作业的完整输出:

Running with gitlab-runner 11.6.1 (id1)
  on gitlab-ci -CzBAN4M
Using Shell executor...
Running on gitserver...
Fetching changes...
HEAD is now at id2 a
From http://gitserver....
Checking out id3 as gitlabci...
Skipping Git submodules setup
$ apk --no-cache add py3-pip python3-dev gcc linux-headers musl-dev libffi-dev openssl-dev git
bash: line 80: apk: command not found
ERROR: Job failed: exit status 1

您的运行程序正在使用不支持 image: 配置的“Shell”执行器,请参阅此 compatibility chart