通过docker在Local主持的詹金斯(Jenkins)在Local主机上运行
我想通过2个条件在Localhost上在Localhost上运行Jenkins。
- 我需要端口443
- 它应该是
https://
而不是http://
我尝试了所有事情,但是我仍然陷入困境。
这是我用来在端口443上运行jenkins的命令:
docker run -p 443:8080 -p 50000:50000:50000 -v〜/jenkins_home:/var/var/jenkins_home jenkins/jenkins/jenkins/jenkins/jenkins/jenkins:lts
it Transfers端口为443,但不会使其成为https。
我在root文件夹(/users/myname/
)中的mkcert
中有我的证书和键。但是我不知道如何将其传输到Jenkins配置。
有办法做到吗?
I want to run jenkins on localhost via docker with 2 conditions.
- I need port 443
- it should be
https://
instead ofhttp://
I tried everything, but I am still stuck with this issues.
This is the command I am using to run jenkins on port 443:
docker run -p 443:8080 -p 50000:50000 -v ~/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
It transfers the port to 443, but does not make it HTTPS.
I have my cert and key from mkcert
in root folder(/users/myname/
). But I do not know how to transfer it to Jenkins configurations.
Is there a way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jenkins初始
-httpsport = $ https_port
:在端口上使用https协议$ https_port
。因此,如果您想使用HTTPS运行Jenkins,则需要:
您有一个完整的示例在此处,运行:
和:
docker run -d -v jenkins_home:/var/var/jenkins_home -v $(哪个docker):/usr/usr/bin/docker -v/var/var/var/var/var/ run/docker.sock:/var/run/docker.sock -p 443:8443 -p 50000:50000 jenkins/jenkins/jenkins:lts -httpport = -1 -1 -httpsport = 8443 -httpskeystore =/httpskeystore =/ .jks -httpskeystorepassword = $ password
The Jenkins initial settings includes
--httpPort=$HTTP_PORT
: To disable (because you’re using HTTPS), use port -1.--httpsPort=$HTTPS_PORT
: Uses HTTPS protocol on port$HTTPS_PORT
.So if you want to run Jenkins with HTTPS, you need:
You have a full example here, run with:
And:
docker run -d -v jenkins_home:/var/jenkins_home -v $(which docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -p 443:8443 -p 50000:50000 jenkins/jenkins:lts --httpPort=-1 --httpsPort=8443 --httpsKeyStore=/var/jenkins_home/jenkins_keystore.jks --httpsKeyStorePassword=$password