Jenkins SSH到docker桥接实例

Jenkins SSH到docker桥接实例,jenkins,docker,ssh,connection-reset,Jenkins,Docker,Ssh,Connection Reset,我正在尝试运行一些Docker实例,以允许Jenkins对它们执行一些作业 我遵循本教程()来实现它。它目前正在创建一些新的docker实例,但没有连接到它们 所有这些新docker实例都必须直接访问物理网络,因此它们必须使用“-net=bridge”构建。每个docker容器的每个端口22都绑定到一个空闲主机端口 所以,问题是我无法通过SSH访问访问任何docker实例。 此外,如果我进入其中一个docker实例,我将无法对localhost执行ssh以获得下一个: [jenkins@d408

我正在尝试运行一些Docker实例,以允许Jenkins对它们执行一些作业

我遵循本教程()来实现它。它目前正在创建一些新的docker实例,但没有连接到它们

所有这些新docker实例都必须直接访问物理网络,因此它们必须使用“-net=bridge”构建。每个docker容器的每个端口22都绑定到一个空闲主机端口

所以,问题是我无法通过SSH访问访问任何docker实例。 此外,如果我进入其中一个docker实例,我将无法对localhost执行ssh以获得下一个:

[jenkins@d4084633f2bc ~]$ ssh localhost -v
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /home/jenkins/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/jenkins/.ssh/id_rsa type -1
debug1: identity file /home/jenkins/.ssh/id_rsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_dsa type -1
debug1: identity file /home/jenkins/.ssh/id_dsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa type -1
debug1: identity file /home/jenkins/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519 type -1
debug1: identity file /home/jenkins/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer
我怎样才能解决这个问题?有人知道吗?
提前感谢。

您确定每个容器上都在运行sshd服务吗
lsof-i tcp:22
netstat-l
是,在这里找到它:
[root@c19af9926797/]#netstat-l活动Internet连接(仅服务器)协议Recv-Q Send-Q本地地址外部地址状态tcp 0.0.0.0:ssh 0.0.0:*侦听tcp6 0 0[::]:ssh[::]:*侦听活动UNIX域套接字(仅服务器)协议引用CNT标志类型状态I节点路径[root@c19af9926797 /]#lsof-i tcp:22 bash:lsof:command未找到
连接正在建立。SSL事务似乎失败。请尝试生成ssh密钥~#ssh密钥根。按照步骤进行操作,然后重试。仍然失败…ssh服务器是否必须拥有RSA密钥对才能允许ssh连接?我不确定。抱歉。