Docker安装Gitlab和Gitlab-Runner并实现项目CICD

Posted pengdonglin137

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker安装Gitlab和Gitlab-Runner并实现项目CICD相关的知识,希望对你有一定的参考价值。

参考:

https://segmentfault.com/a/1190000020593208

https://www.cnblogs.com/zzhaolei/p/11063345.html

https://docs.gitlab.com/runner/configuration/advanced-configuration.html

https://docs.gitlab.com/runner/register/#docker

https://docs.gitlab.com/runner/install/docker.html

 

可以参考下面的:

 

1、运行gitlab-runner

sudo docker run -d --name gitlab-runner --restart always             -p 8093:8093             -v /var/run/docker.sock:/var/run/docker.sock             -v /volume1/homes/pengdonglin137/gitlab-runner-config:/etc/gitlab-runner             gitlab/gitlab-runner:latest

 

2、注册

sudo docker exec -it gitlab-runner gitlab-runner register

 

3、重启

sudo docker exec -it gitlab-runner gitlab-runner restart

 

config.toml:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "docker_runner"
  url = "http://192.168.1.102:30000/"
  token = "oMjNxBsuCqgxEBUmXRZj"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.docker]
    tls_verify = false
    image = "ubuntu:16.04"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock","/volume1/homes/pengdonglin137/opt:/opt:rw"]
    pull_policy = "if-not-present"
    shm_size = 0

 

完。

以上是关于Docker安装Gitlab和Gitlab-Runner并实现项目CICD的主要内容,如果未能解决你的问题,请参考以下文章

GitLab安装和配置(Docker)

GitLab安装和配置(Docker)

GitLab安装和配置(Docker)

2020.04.17以Docker形式安装gitlab和gitlab-runner

使用Docker部署Gitlab

Gitlab - docker 安装实例