Jenkins发布在ssh上 - 无法迁移服务器配置 [英] Jenkins with publish over ssh - unable to migrae server configuration

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

问题描述

我正在使用Jenkins(2.32.2)Docker容器和Publish over ssh插件(1.17),我已经手动添加了新的服务器。
新添加的服务器是另一个Docker容器(都使用docker-compose运行),并且我正在使用密码来连接它,并且手动进行时一切都正常工作,但问题是当我重建图像。



我已经在jenkins目录中使用了一个卷,它的工作原理很好。问题仅在于初始安装(例如图像构建,而不是容器重新启动)。



似乎问题是使用密钥,我发现我还需要在创建我的图像时复制一些键。



查看通过ssh文档发布的凭据部分



我试图复制所有的secrets目录和以下文件:secret.key,secret.key.not-so-secret,identity.key.enc - 但是,在新安装之后我仍然无法连接。



什么我错过了吗?



编辑:
我刚刚尝试复制我的DOCKERFILE上的整个jenkins_home目录,它的工作原理,所以我猜问题是先加载还是什么?可能Jenkins会在第一次加载时改变键/盐?



谢谢。

解决方案>

尝试将jenkins配置推送到docker主机到要安装docker主机的os

  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 


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.

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.

See the credentials section at Publish over ssh documentation

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.

What am I missing?

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?

Thanks.

解决方案

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

or

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

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

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