美文网首页
2019-10-05 【Gitlab】使用 docker 运行

2019-10-05 【Gitlab】使用 docker 运行

作者: 耕耘菜菜 | 来源:发表于2019-10-05 21:23 被阅读0次
    1. 拉取镜像
    docker pull gitlab/gitlab-ce:latest
    
    1. docker 运行 Gitlab

    /srv/gitlab 为主机 gitlab 的目录

    sudo docker run --detach \
      --hostname gitlab.example.com \
      --publish 443:443 --publish 80:80 --publish 22:22 \
      --name gitlab \
      --restart always \
      --volume /srv/gitlab/config:/etc/gitlab \
      --volume /srv/gitlab/logs:/var/log/gitlab \
      --volume /srv/gitlab/data:/var/opt/gitlab \
      gitlab/gitlab-ce:latest
    
    1. 注册 runner
    [root@test-server gitlab-runner]$ docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
    
    Runtime platform                                    arch=amd64 os=linux pid=8 revision=a6a017e0 version=12.3.0
    Running in system-mode.
    
    Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
    http://gitlab.example.com:80/
    
    Please enter the gitlab-ci token for this runner:
    VEmag2FJCJsJuSAHQbtz
    
    Please enter the gitlab-ci description for this runner:
    [8857df3a8756]: test-runner
    
    Please enter the gitlab-ci tags for this runner (comma separated):
    test-runner
    Registering runner... succeeded                     runner=VEagb2CJ
    
    Please enter the executor: docker-ssh+machine, docker-ssh, parallels, shell, virtualbox, kubernetes, custom, docker, ssh, docker+machine:
    docker
    
    Please enter the default Docker image (e.g. ruby:2.6):
    alpine:latest
    
    Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
    
    1. 登录 http://gitlab.example.com:80/admin/runners 查看 runners
    image.png

    参考资料

    相关文章

      网友评论

          本文标题:2019-10-05 【Gitlab】使用 docker 运行

          本文链接:https://www.haomeiwen.com/subject/zisypctx.html