修复gitlab-runner镜像

This commit is contained in:
KennyLee 2019-06-27 09:34:10 +08:00
parent 6845e7bfae
commit 2f2700705a
4 changed files with 12 additions and 7 deletions

4
gitlab-runner/.env Normal file
View File

@ -0,0 +1,4 @@
RUNNER_TOKEN=ziz3YmA9fqaQ4K1wVmAU
RUNNER_DESCRIPTION=new-docker-executor
CI_SERVER_URL=http://192.168.3.231:10080/ci

View File

@ -3,7 +3,7 @@
# Authoer: kennylee26
# Command format: Instruction [arguments command] ..
FROM registry.alauda.cn/kenny/gitlab-ci-multi-runner
FROM sameersbn/gitlab-ci-multi-runner
# 维护者信息
MAINTAINER kennylee26 <kennylee26@gmail.com>

View File

@ -4,8 +4,9 @@
1. 注意宿主机的防火墙会造成runner无法绑定gitlab的问题。
2. 由于使用 [sameersbn/docker-gitlab-ci-multi-runner](https://github.com/sameersbn/docker-gitlab-ci-multi-runner) 所以,`EXECUTOR=shell` 仅支持是shell。
3. 请根据实际部署环境修改 `RUNNER_TOKEN` `RUNNER_TOKEN``extra_hosts` 中的域名
3. 请根据实际部署环境修改 `.env` 文件中的配置和docker-compose.yml中的`extra_hosts`
4. `docker`环境下的gitlab使用hostname作为域名不配置网络的情况下会导致构建失败问题。所以设置了gitlab的hostname。runner中也需要对应的设置gitlab访问的ip地址。
5.
image主要修改

View File

@ -1,17 +1,17 @@
version: '2'
services:
runner:
build: .
image: registry.cn-hangzhou.aliyuncs.com/kennylee/gitlab-ci-multi-runner
container_name: gitlab-runner
restart: always
restart: on-failure
volumes:
- ./data:/home/gitlab_ci_multi_runner/data:z
- /var/run/docker.sock:/var/run/docker.sock
environment:
- TZ=Asia/Shanghai
- CI_SERVER_URL=http://192.168.3.231:10080/ci
- RUNNER_TOKEN=ziz3YmA9fqaQ4K1wVmAU
- RUNNER_DESCRIPTION=new-docker-executor
- CI_SERVER_URL=${CI_SERVER_URL}
- RUNNER_TOKEN=${RUNNER_TOKEN}
- RUNNER_DESCRIPTION=${RUNNER_DESCRIPTION}
- RUNNER_EXECUTOR=shell
extra_hosts:
- "gitlab.foo.com:192.168.3.231"