指令:
sudo docker network create jenkins
sudo docker volume create jenkins-data
sudo docker volume create jenkins-docker-certs
sudo docker container run \
--name jenkins-docker \
--rm \
--detach \
--privileged \
--network jenkins \
--network-alias docker \
--env DOCKER_TLS_CERTDIR=/certs \
--volume jenkins-docker-certs:/certs/client \
--volume jenkins-data:/var/jenkins_home \
--publish 2376:2376 \
docker:dind
sudo docker container run \
--name jenkins-blueocean \
--rm \
--detach \
--network jenkins \
--env DOCKER_HOST=tcp://docker:2376 \
--env DOCKER_CERT_PATH=/certs/client \
--env DOCKER_TLS_VERIFY=1 \
--publish 8080:8080 \
--publish 50000:50000 \
--volume jenkins-data:/var/jenkins_home \
--volume jenkins-docker-certs:/certs/client:ro \
jenkinsci/blueocean
sudo docker exec jenkins-blueocean cat /var/jenkins_home/secrets/initialAdminPassword
參考資料:
https://blog.cloudware.bg/en/what-is-jenkins-and-how-to-install-it-on-your-server/
https://davelms.medium.com/run-jenkins-in-a-docker-container-part-1-docker-in-docker-7ca75262619d
https://www.cnblogs.com/esofar/p/11163583.html
沒有留言:
張貼留言