docker jenkins

配置防火墙

systemctl start firewalld.service
firewall-cmd --permanent --zone=public --add-port=8000/tcp 
systemctl restart firewalld.service

配置阿里云yum源

yum install -y wget
mv /etc/yum.repos.d /etc/yum.repos.d.bak
mkdir /etc/yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache

安装 Docker

#使用yum安装docker
yum install -y yum-utils  device-mapper-persistent-data lvm2
yum-config-manager --add-repo  https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
systemctl enable docker
systemctl start docker

配置docker加速镜像

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
     
  "registry-mirrors": ["https://eh3x8cdp.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker

运行jenkins

#运行 - 使用jenkinsci/blueocean镜像,包含blueocean,也可以使用 官方镜像:jenkins
docker run --name=jenkins -p 8000:8080 -p 50000:50000 -idt jenkinsci/blueocean
#查看日志,首次启动日志中有密码串
docker logs -f jenkins
#停止
docker stop jenkins
#启动
docker start jenkins

你可能感兴趣的:(项目管理,jenkin,docker)