docker 部署jenkins

赏花赏月赏秋香發表於2024-08-22
#檢視jenkins映象
docker search jenkins
#安裝jenkins
docker pull jenkins/jenkins:lts
#jenkins 掛載目錄
mkdir -p /home/jenkins/workspace
#啟動jenkins
docker run -uroot -d --restart=always -p 9001:8080 \
 -v /home/jenkins/workspace/:/var/jenkins_home/workspace \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /usr/local/maven/apache-maven-3.8.8:/usr/local/maven \
 --name jenkins jenkins/jenkins:lts
#-uroot 是以管理員身份登入容器檢視密碼
docker exec -it -uroot jenkins bash  

#jenkins ci/cd 外掛
#Maven Integration
#Publish Over SSH
#Git

docker cp /usr/local/java/jdk1.8.0_181/. jenkins:/usr/local/jdk8
docker cp /usr/local/maven/apache-maven-3.8.8/. jenkins:/usr/local/maven

參考連結:

https://blog.csdn.net/qq_51726114/article/details/134174736

https://blog.csdn.net/dontYouWorry/article/details/129007966

https://blog.csdn.net/qq_36858491/article/details/136525564

相關文章