Docker-compose定义的Jenkins服务
twqc-jenkins:
image: ***
user: root
ports:
- 8080:8080
- 50000:50000
restart: always
container_name: boot-jenkins
hostname: boot-jenkins
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
- /usr/bin/docker:/usr/bin/docker
- /var/run/docker.sock:/var/run/docker.sock
- /usr/local/bin/docker-compose:/usr/local/bin/docker-compose
- /data/jenkins_home:/var/jenkins_home
宿主机Docker操作
# 宿主机退出登录(失去权限的账号)
docker logout harbor仓库地址
# 宿主机切换成有权限的账号重新登录
docker login harbor仓库地址
Jenkins容器内部操作
# 宿主机退出登录(失去权限的账号)
docker logout harbor仓库地址
# 宿主机切换成有权限的账号重新登录
docker login harbor仓库地址