docker安装
- 创建数据挂在并给予权限
mkdir -p /opt/docker/jenkins
chmod 777 /opt/docker/jenkins
- 启动容器
docker run --name jenkins -d -p 8888:8080 \
-v /etc/localtime:/etc/localtime \
-v /opt/docker/jenkins:/var/jenkins_home \
jenkins/jenkins:lts
compose安装
image: 'jenkins/jenkins:lts'
container_name: jenkins
restart: always
environment:
- TZ=Asia/Shanghai
ports:
- '8928:8080'
- '50000:50000'
volumes:
- '/etc/localtime:/etc/localtime'
- './data:/var/jenkins_home'
- '/var/run/docker.sock:/var/run/docker.sock'
- '/usr/bin/docker:/usr/bin/docker'
标签:opt,etc,var,jenkins,docker,安装,localtime
From: https://www.cnblogs.com/z8080/p/17036175.html