Registering GITLAB-Runners

  • Install it on a (bare metal server or on docker container ) server separate than where GitLab is installed on
  • Obtain a token for a shared or specific Runner via GitLab’s interface (Gitlab UI -> Project or group -> settings -> CI/CD -> Runners -> copy url and token also)
  • First Method : To register a Runner (Bare Metal Server ) under GNU/Linux:
1. #sudo gitlab-runner register
After run this command enter below information
2. Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) https://gitlab.com3. Please enter the gitlab-ci token for this runner
xxx
4. Please enter the gitlab-ci description for this runner [hostname] my-runner5. Please enter the gitlab-ci tags for this runner (comma separated): my-tag,another-tag6. Please enter the executor (Choose shell): ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
shell
7. Check on Gitlab GUI under : Gitlab UI -> Project or group -> settings -> CI/CD -> Runners
IF choose docker executor then use alpine:latest image.
  1. Install Docker and create volume for gitlab runner
    docker volume create gitlab-runner-config
  2. Run Register Command:
    docker run -d --name gitlab-runner --restart always -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config:/etc/gitlab-runner gitlab/gitlab-runner:latest
    If you change the configuration in config.toml, you might need to restart the runner to apply the change. Make sure to restart the whole container instead of using gitlab-runner restart:
    docker restart gitlab-runner

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store