从Windows Docker WSL2启动时,Jenkins仪表板未显示在localhost:8080 [英] Jenkins dashboard does not show at localhost:8080 when launched from Windows Docker WSL2

查看:166
本文介绍了从Windows Docker WSL2启动时,Jenkins仪表板未显示在localhost:8080的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 10 Home,WSL2,Jenkins 2.263,Docker

Windows 10 Home, WSL2, Jenkins 2.263, Docker

我正在学习Jenkins,并正在完成Starmer的教程.

I am learning Jenkins and doing the tutorial by Starmer.

在ubuntu终端(Windows 10 Home WSL2)中,我运行了提供的代码:

In an ubuntu terminal (Windows 10 Home WSL2) I ran the provided code:

useradd jenkins -m
docker run \
  -u jenkins \
  --rm \
  -d \
  -p 8080:8080 \
  -p 50000:50000 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /home/jenkins:/var/jenkins_home \
  jenkins/jenkins:lts
cat /home/jenkins/secrets/initialAdminPassword

但是当我在浏览器中打开localhost:8080时,我看到了

But when I open localhost:8080 in my browser, instead of seeing the Jenkins dashboard, I see

但是当我从Docker停止容器并从java -jar jenkins.war启动Jenkins时,我可以在localhost:8080看到仪表板

But when I stop the container from Docker and launch Jenkins from java -jar jenkins.war then I can see the dashboard at localhost:8080

我还尝试从Docker Desktop删除jenkins文件夹和jenkins/jenkins:lts映像,然后再次将其拉出并获取

I also tried deleting the jenkins folder, and the jenkins/jenkins:lts image from Docker Desktop and pulled again and get

cat: /home/jenkins/secrets/initialAdminPassword: No such file or directory

推荐答案

它开始工作.我不知道是什么解决了问题,但这是我尝试过的:

It started working. I don't know what fixed it but these are what I tried:

  1. 在Docker桌面中,将所有数据重置为出厂默认值
  2. 创建ubuntu超级用户密码,并执行su -
  3. 关闭实验性Docker功能启用云".
  4. 我在Docker桌面的控制台中找到了秘密的管理员密码,在ubuntu shell中找到了.
  1. In Docker Desktop, reset all data to factory defaults
  2. Created ubuntu root password and did a su -
  3. Turned off experimental Docker feature "cloud enabled".
  4. I found the secret admin password in the Console in Docker desktop, not in the ubuntu shell.

现在我可以转到localhost:8080并输入管理员密码.

Now I was able to go to localhost:8080 and enter the admin password.

这篇关于从Windows Docker WSL2启动时,Jenkins仪表板未显示在localhost:8080的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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