Jenkins与通过SSH发布-无法迁移服务器配置 [英] Jenkins with publish over ssh - unable to migrate server configuration

查看:194
本文介绍了Jenkins与通过SSH发布-无法迁移服务器配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Jenkins(2.32.2)Docker容器与Publish over ssh插件(1.17)配合使用,并且我手动添加了新服务器。
新添加的服务器是另一个Docker容器(均与docker-compose一起运行),并且我使用密码连接到该容器,手动进行操作时一切正常,但问题是当我重建时

I am using Jenkins (2.32.2) Docker container with the Publish over ssh plugin (1.17) and I have added a new server manually. The newly added server is another Docker container (both running with docker-compose) and I am using a password to connect to it, and everything works just fine when doing it manually, but the problem is when I'm rebuilding the image.

我已经在jenkins消失的目录中使用了一个卷,并且工作正常。问题仅在于初始安装(例如,映像生成,而不是容器重启)。

I am already using a volume for the jenkins gone directory and it works just fine. The problem is only on the initial installation (e.g. image build, not a container restart).

似乎问题出在密钥上,我发现创建图像时,我还需要复制一些密钥。

It seems like the problem is with the secret key, and I found out that I also need to copy some keys when creating my image.

参见通过ssh文档发布中的凭据部分

我尝试复制所有秘密目录以及以下内容文件:secret.key,secret.key.not-so-secret,identity.key.enc-但全新安装后我仍然无法连接。

I tried to copy all the "secrets" directory and the following files: secret.key, secret.key.not-so-secret, identity.key.enc - but I still can't connect after a fresh install.

什么我想念吗?

编辑:
我只是试图将整个jenkins_home目录复制到DOCKERFILE上,并且它可以正常工作,所以我想问题出在第一次加载还是什么?也许詹金斯(Jenkins)在第一次加载时更改了密钥/盐?

Edited: I just tried to copy the whole jenkins_home directory on my DOCKERFILE and it works, so I guess that the problem is with the first load or something? maybe Jenkins changes the key / salt on the first load?

谢谢。

推荐答案

尝试将jenkins配置推送到安装了docker主机的操作系统的docker主机

try to push out jenkins config to docker host of to os where docker host is being installed

docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins

docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v ./local/conf:/var/jenkins_home jenkins

这篇关于Jenkins与通过SSH发布-无法迁移服务器配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆