install docker-ce
1 2 3 4 5 6 7
| yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine -y
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io -y
|
增加腾讯云加速器
1 2 3 4 5 6
| cat /etc/docker/daemon.json { "registry-mirrors": [ "https://mirror.ccs.tencentyun.com" ] }
|
启动docker服务
systemctl start docker
拉起一个容器,测试验证docker
docker run hello-world
install gitlab-runner
1 2 3 4
| wget https://mirrors.cloud.tencent.com/gitlab-runner/yum/el7/gitlab-runner-12.7.1-1.x86_64.rpm
yum install -y gitlab-runner-12.7.1-1.x86_64.rpm
|
补充:如果是二进制安装gitlan-runner,这需要以下添加:
1 2 3 4 5 6 7 8 9
| ### creat gitlab-runner user and set docker useradd /bin/ groupadd gpasswd newgrp su docker gitlab-runner /home/ gitlab-runner
|
gitlab-runner向gitlab注册,并install和start gitlab-runner
1 2 3 4 5
| gitlab-runner register
gitlab-runner install
gitlab-runner start
|
git push code and check gitlab-cicd jobs