gitlab-runner 报 operation not permitted 错误!!!
time="2022-01-11T05:42:12Z" level=debug msg="serving grpc connection" spanID=712030f606471eb6 traceID=67b61eebeb305b20ed43e7f6b0a2bb00
[34](http://git.efara.cn/handheld-terminal/wms-app-android/-/jobs/11334#L34)time="2022-01-11T05:42:12Z" level=debug msg="stopping session" spanID=712030f606471eb6 traceID=67b61eebeb305b20ed43e7f6b0a2bb00
[35](http://git.efara.cn/handheld-terminal/wms-app-android/-/jobs/11334#L35)#1 [internal] load build definition from Dockerfile.ci
[36](http://git.efara.cn/handheld-terminal/wms-app-android/-/jobs/11334#L36)#1 transferring dockerfile: 741B done
[37](http://git.efara.cn/handheld-terminal/wms-app-android/-/jobs/11334#L37)#1 DONE 0.0s
[38](http://git.efara.cn/handheld-terminal/wms-app-android/-/jobs/11334#L38)error: failed to solve: failed to read dockerfile: failed to mount /tmp/buildkit-mount957981029: [{Type:bind Source:/var/lib/buildkit/runc-native/snapshots/snapshots/1 Options:[rbind ro]}]: operation not permitted
解决方法:
将runner改为特权模式
修改config.toml
路径如下:
/etc/gitlab-runner/config.toml
将对应runner的 privileged = flase 改为 privileged = true即可 如下:
[[runners]]
name = "android-sdk-3002"
url = "http://git.efara.cn/"
token = "nQQ44-EhZguVZNiP7CYD"
executor = "docker"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.docker]
tls_verify = false
image = "docker"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
然后
git-runner restart
即可