利用docker快速部署jenkins

  • 第1步,安装docker环境
curl -sL 'http://iso.sqlfans.cn/docker/install_docker_2401.sh' | bash
curl -sL 'http://iso.sqlfans.cn/docker/install_docker_compose_2181.sh' | bash
docker-compose --version
  • 第2步,利用docker快速部署jenkins
docker pull jenkins/jenkins:lts
mkdir -p /data/docker/jenkins
chmod 777 -R /data/docker/jenkins
docker run -itd -p 8080:8080 -p 50000:50000 --privileged=true -v /data/docker/jenkins/:/var/jenkins_home -v /etc/localtime:/etc/localtime --name jenkins jenkins/jenkins:lts
docker ps -a
  • 第3步,登录控制台,将 127.0.0.1 改为实际的ip地址
地址:http://127.0.0.1:8080
账号:root
初始密码:docker exec -it jenkins /bin/bash -c 'cat /var/jenkins_home/secrets/initialAdminPassword'
重置密码:Admin_147
  • 附1:如何全部铲掉
docker stop jenkins
docker rm jenkins
docker rmi -f $(docker images | grep "jenkins" | awk '{print $3}')
rm -rf /data/docker/jenkins
Copyright © www.sqlfans.cn 2024 All Right Reserved更新时间: 2024-06-17 17:16:52

results matching ""

    No results matching ""