【发布时间】:2019-07-19 12:21:07
【问题描述】:
我正在设置 jenkins 以通过 docker 运行。但似乎遇到了障碍。
通过 CLI 登录验证 docker 已安装并且 jenkins 镜像已安装。
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 8 weeks ago 1.84kB
jenkins latest cd14cecfdb3a 7 months ago 696MB
设置端口
docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home:z -t jenkins
验证容器正在运行:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ff1f21312230 jenkins "/bin/tini -- /usr/l…" About an hour ago Up About an hour 50000/tcp, 0.0.0.0:49001->8080/tcp nostalgic_mestorf
检查主机是否可以在本地访问
curl localhost:49001
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'/><script>window.location.replace('/login?from=%2F');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Administer
-->
</body></html>
尝试连接到 8080 端口不起作用。
curl localhost:8080
curl: (7) Failed connect to localhost:8080; Connection refused
在 AWS 上运行 Red Hat Enterprise Linux Server 7.6 (Maipo)
如何允许访问以便 Jenkins 加载?我究竟做错了什么?任何帮助,将不胜感激。
【问题讨论】:
标签: amazon-web-services docker jenkins