Docker端口绑定不按预期工作

在绑定到主机端口9090的容器中运行Jenkins图像

sudo docker run -itd -p 9090:8080 -p 50000:50000 --name=myjenkins -t jenkins-custom /bin/bash 

运行$docker port myjenkins的输出

 50000/tcp -> 0.0.0.0:50000 8080/tcp -> 0.0.0.0:9090 

我也可以从主机的angular度看到绑定ps -Af | grep proxy ps -Af | grep proxy

 root 15314 15194 0 17:52 ? 00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 50000 -container-ip 172.17.0.2 -container-port 50000 root 15325 15194 0 17:52 ? 00:00:00 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9090 -container-ip 172.17.0.2 -container-port 8080 

启动我的jenkins服务器后,我尝试使用主机IP和转发的端口(9090)连接到容器。

我是新来的Docker,所以可能错过了一些东西,但会欣赏build议

更新:包括dockerfile

 From local-artifiactory/jenkinsci/jenkins:2.9 ENV java_opts="-Xmx8192m" 

问题是没有服务在这些端口上运行。 运行的唯一过程是/ bin / bash(在行尾指定)。 你必须在容器内启动Jenkins。