获取Jenkins镜像
docker pull jenkins
创建文件夹
sudo mkdir /home/jenkins_home
修改权限权限
sudo chown -R 1000:1000 /home/jenkins_home
启动容器
docker run -itd -p 8080:8080 -p 50000:50000 --name jenkins --privileged=true -v /home/jenkins_home:/var/jenkins_home jenkins:latest
启动后查看:
[email protected]:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6f007ec86071 jenkins:latest "/bin/tini -- /usr..." 5 seconds ago Up 4 seconds 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp jenkins
容器已经启动了,访问一下宿主机ip+8080
原文地址:https://www.cnblogs.com/gcgc/p/10191557.html
时间: 2024-10-09 06:05:57