Giter Club home page Giter Club logo

gitlab-docker's Introduction

  • $RUNNER_TOKEN(注册令牌):TD1kkBT3NCLxKaFySnKx
  • $URL(服务器地址):gitlab (容器内地址)
  • $GITLAB_CONFIG(gitlab 配置文件地址):/Users/user/Documents/gitlab-cicd/gitlab/config
  • $GITLAB_LOG(gitlab 日志地址):/Users/user/Documents/gitlab-cicd/gitlab/logs
  • $GITLAB_DATA(gitlab 数据文件地址):/Users/user/Documents/gitlab-cicd/gitlab/data
  • $GITLAB_RUNNER_CONFIG(gitlab-runner 配置文件地址):/Users/user/Documents/gitlab-cicd/gitlab-runner/config

安装 gitlab

docker run -d \
           -h $URL \
           -p 443:443 \
           -p 80:80 \
           -p 222:22 \
           --name gitlab \
           --restart always \
           -v $GITLAB_CONFIG:/etc/gitlab \
           -v GITLAB_LOG:/var/log/gitlab \
           -v $GITLAB_DATA:/var/opt/gitlab \
           gitlab/gitlab-ce:latest
docker run -d \
           -h gitlab \
           -p 443:443 \
           -p 80:80 \
           -p 222:22 \
           --name gitlab \
           --restart always \
           -v C:\Users\Adrian.wang\gitlab-docker\gitlab\config\config:/etc/gitlab \
           -v C:\Users\Adrian.wang\gitlab-docker\gitlab\config\log:/var/log/gitlab \
           -v C:\Users\Adrian.wang\gitlab-docker\gitlab\config\data:/var/opt/gitlab \
           gitlab/gitlab-ce:latest

安装 gitlab-runner

docker run -d \
           --name gitlab-runner --restart always \
           -v $GITLAB_RUNNER_CONFIG:/etc/gitlab-runner \
           -v /var/run/docker.sock:/var/run/docker.sock \
           gitlab/gitlab-runner:latest

创建一个 docker 网络

docker network create gitlab-network

加入同一个 docker 网络

docker network connect gitlab-network gitlab
docker network connect gitlab-network gitlab-runner

注册 gitlab-runner

docker run --rm -v $GITLAB_RUNNER_CONFIG:/etc/gitlab-runner gitlab/gitlab-runner register \
  --non-interactive \
  --url "https://$URL/" \
  --token "$RUNNER_TOKEN" \
  --executor "docker" \
  --docker-image alpine:latest \
  --description "docker-runner"
docker run --rm -v /Users/user/Documents/gitlab-cicd/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
  --non-interactive \
  --url "https://localhost/" \
  --token "TD1kkBT3NCLxKaFySnKx" \
  --executor "docker" \
  --docker-image alpine:latest \
  --description "docker-runner"

gitlab-docker's People

Contributors

adrianwangs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.