简体   繁体   English

如何在 podman 容器中设置 gitlab-runner 以使用执行程序选项 docker(使用 podman)

[英]How to setup gitlab-runner in a podman container to use the executor option docker (to use podman)

Using podman run and setting up the gitlab-runner works withoud a problem.使用 podman run 并设置 gitlab-runner 可以正常工作。 However, how does one now set the executor to use podman?但是,现在如何设置执行程序以使用 podman? Shell works, but this isn't as clean as using the docker executor. Shell 有效,但这不如使用 docker 执行器干净。

Does anyone have an idea how to set the gitlab-runner container to use this executor?有谁知道如何设置 gitlab-runner 容器来使用这个执行器?

I had to mount the following socket as a volume: /var/run/podman:/var/run/podman (no need for:Z on selinux).我必须将以下套接字作为卷安装: /var/run/podman:/var/run/podman (selinux 上不需要:Z)。 This won't be enough as the permission from the container side will only be?.这还不够,因为来自容器端的许可只会是?。 To fix this add the following security opt: label:disable .要解决此问题,请添加以下安全选项: label:disable

After you setup the pod, go through the registration and choose docker. Once it registered edit the config.toml with the following:设置 pod 后,通过注册 go 并选择 docker。注册后,使用以下内容编辑 config.toml:

host = "unix:///var/run/podman/podman.sock"

You do not need to use privileged anywhere inorder to make gitlab-runner work.你不需要在任何地方使用特权来让 gitlab-runner 工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM