以我为例,
我在 Apple Silicon M1 上添加了一个运行程序,但该运行程序无法启动。 这就是为什么我给它分配了一个项目,希望能够开始,但我看到了这个
这就是我所做的。
创建docker runner:
docker stop gitlab-runner && docker rm gitlab-runner
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
报名跑者:
docker run --rm -v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
--non-interactive \
--executor "docker" \
--docker-image hannesa2/android-ndk:api28_emu \
--url "http://latitude:8083/" \
--registration-token "<TOKEN>" \
--description "M1 pro Android NDK + Emu" \
--tag-list "android,android-ndk,android-emu" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected"
我在 docker log 中看到了这个
Runtime platform arch=arm64 os=linux pid=8 revision=4b9e985a version=14.4.0
Starting multi-runner from /etc/gitlab-runner/config.toml... builds=0
Running in system-mode.
Configuration loaded builds=0
listen_address not defined, metrics & debug endpoints disabled builds=0
[session_server].listen_address not defined, session endpoints disabled builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0
ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0
Configuration loaded builds=0
主机附带此文件 /Users/Shared/gitlab-runner/config/config.toml
谢谢你
您正在使用
-v /srv/gitlab-runner/config:/etc/gitlab-runner
启动跑步者。但注册使用不同的卷路径 (-v /Users/Shared/gitlab-runner/config:/etc/gitlab-runner
)。
所以实际的运行者无法找到注册命令正在写入的配置。您应该为两次调用使用相同的主机路径。
就我而言,这是一个非常好的答案,而且效果非常好。谢谢你。