gpt4 book ai didi

docker - Docker-ssh非根路径/getsockopt:连接被拒绝

转载 作者:行者123 更新时间:2023-12-02 20:02:29 25 4
gpt4 key购买 nike

我正在尝试将gitlab-runner与docker-ssh结合使用。这是我的config.toml的样子:

[[runners]]
name = “CI/CD docker-ssh alfa”
url = “https://gitlab.com/”
token = “<SOME_TOKEN>“
executor = “docker-ssh”
[runners.ssh]
user = “myuser”
password = “my password”
[runners.docker]
tls_verify = false
image = “ubuntu:latest”
privileged = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]

但是我得到了这个错误:
Running with gitlab-runner 11.3.0 (d78e9e67)
on CI/CD docker-ssh alfa 1f147b76
Using Docker executor with image ubuntu:latest …
ERROR: Preparation failed: build directory needs to be absolute and non-root path
Will be retried in 3s …
Using Docker executor with image ubuntu:latest …
ERROR: Preparation failed: build directory needs to be absolute and non-root path

所以我尝试更改构建目录,这里的config.toml文件如下所示:
[[runners]]
name = “CI/CD docker-ssh alfa”
url = “https://gitlab.com/”
token = “<SOME_TOKEN>“
executor = “docker-ssh”
builds_dir = “/home/myuser/“
[runners.ssh]
user = “myuser”
password = “my password”
[runners.docker]
tls_verify = false
image = “ubuntu:latest”
privileged = false
disable_cache = false
volumes = [”/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]

但是我收到了这个新错误:
Running with gitlab-runner 11.3.0 (d78e9e67)
on CI/CD docker-ssh alfa 1f147b76
Using Docker executor with image ubuntu:latest …
WARNING: Since GitLab Runner 10.0 docker-ssh and docker-ssh+machine executors are marked as DEPRECATED and will be removed in one of the upcoming releases
Pulling docker image ubuntu:latest …
Using docker image sha256:cd6d8154f1e16e38493c3c2798977c5e142be5e5d41403ca89883840c6d51762 for ubuntu:latest …
ERROR: Preparation failed: dial tcp 172.17.0.2:22: getsockopt: connection refused
Will be retried in 3s …

知道我在做什么错吗?

最佳答案

坚持使用HTTPS URL,然后尝试修复错误:

build directory needs to be absolute and non-root path
参见 this thread

I was running my CI on an old gitlab-ci-multi-runner 9.5.1.

I update to gitlab-runner 10.8.0 and now it’s ok.


this thread:

Set build_dir="C:\\gitlab-runner\\builds" in the config.toml.

关于docker - Docker-ssh非根路径/getsockopt:连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52472569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com