gitlab+GitLab Runner注册

gitlab部署文档

docker部署:

准备映射目录
mkdir -p /data/gitlab-runner/config
启动
docker run -itd --restart=always --name gitlab-runner \
-v /data/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock  gitlab/gitlab-runner:latest  

进入容器 docker exec -it gitlab-runner bash

本地部署

概览-Runner可以找到注册的令牌

点击【显示runner安装和注册说明】-选择linux可以获取安装方法和注册命令
下载二进制文件
curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
执行权限
chmod +x /usr/local/bin/gitlab-runner
增加用户
 useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
指定工作目录:
gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
启动:
gitlab-runner start

注册:

容器部署就在Runner容器里执行,物理机就在本地执行

本地注册

注册成功

你可能感兴趣的:(gitlab+GitLab Runner注册)