Jenkins启动--war包启动
Jenkins启动--war包启动:
- java -jar jenkins.war
- 将jenkins.war放到tomcat webapps下。启动tomcat, 访问localhost:8080/jenkins;
-
Jenkins默认端口号是8080,而8080被占用了,只要把端口号改了就行了:
java -jar jenkins.war –httpPort=$HTTP_PORT。例如:java -jar jenkins.war –httpPort=1080
Jenkins启动--docker启动:
- 需要找到一台安装好了docker的机器
- 启动jenkins容器:docker run --name tech_jenkins -p 8980:8080 -p 50000:50000 --restart -v /Users/naruto0728/runtimeEnvironment/dockerdata/jenkins:/var/jenkins_home jenkins/jenkins
- Jenkins服务器地址:http://<linux_IP>:8980/
- 进入docker容器内部找到密码,参考命令:docker exec -it myjenkins bash