Skip to content
Snippets Groups Projects
Commit 3ba44ed1 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Move Runner registration info in a separate document

parent 0d32955b
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,12 @@ information on the different installation methods: ...@@ -58,6 +58,12 @@ information on the different installation methods:
- [Install on Kubernetes](install/kubernetes.md) - [Install on Kubernetes](install/kubernetes.md)
- [Install the nightly binary manually (development)](install/bleeding-edge.md) - [Install the nightly binary manually (development)](install/bleeding-edge.md)
## [Register GitLab Runner](register/index.md)
Once GitLab Runner is installed, you need to register it with GitLab.
Learn how to [register a GitLab Runner](register/index.md).
## Using GitLab Runner ## Using GitLab Runner
- [See the commands documentation](commands/README.md) - [See the commands documentation](commands/README.md)
......
...@@ -4,66 +4,46 @@ This is how you can run GitLab Runner inside a Docker container. ...@@ -4,66 +4,46 @@ This is how you can run GitLab Runner inside a Docker container.
## Docker image installation and configuration ## Docker image installation and configuration
Install Docker first: 1. Install Docker first:
```bash ```bash
curl -sSL https://get.docker.com/ | sh curl -sSL https://get.docker.com/ | sh
``` ```
We need to mount a config volume into our `gitlab-runner` container to 1. You need to mount a config volume into the `gitlab-runner` container to
be used for configs and other resources: be used for configs and other resources:
```bash ```bash
docker run -d --name gitlab-runner --restart always \ docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \ -v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest gitlab/gitlab-runner:latest
``` ```
Or, you can use a config container to mount your custom data volume: Or, you can use a config container to mount your custom data volume:
```bash ```bash
docker run -d --name gitlab-runner-config \ docker run -d --name gitlab-runner-config \
-v /etc/gitlab-runner \ -v /etc/gitlab-runner \
busybox:latest \ busybox:latest \
/bin/true /bin/true
docker run -d --name gitlab-runner --restart always \ docker run -d --name gitlab-runner --restart always \
--volumes-from gitlab-runner-config \ --volumes-from gitlab-runner-config \
gitlab/gitlab-runner:latest gitlab/gitlab-runner:latest
``` ```
If you plan on using Docker as the method of spawning Runners, you will need to If you plan on using Docker as the method of spawning Runners, you will need to
mount your docker socket like this: mount your docker socket like this:
```bash ```bash
docker run -d --name gitlab-runner --restart always \ docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \ -v /srv/gitlab-runner/config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest gitlab/gitlab-runner:latest
``` ```
Register the runner (Look into [runners documentation](http://docs.gitlab.com/ce/ci/runners/README.html) to learn how to obtain a token):
```bash
docker exec -it gitlab-runner gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
docker
Please enter the Docker image (eg. ruby:2.1):
ruby:2.1
INFO[0037] Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!
```
The runner should is started already and you are ready to build your projects! 1. [Register the Runner](../register/index.md)
Make sure that you read the [FAQ](../faq/README.md) section which describes Make sure that you read the [FAQ](../faq/README.md) section which describes
some of the most common problems with GitLab Runner. some of the most common problems with GitLab Runner.
...@@ -91,8 +71,10 @@ docker run -d --name gitlab-runner --restart always \ ...@@ -91,8 +71,10 @@ docker run -d --name gitlab-runner --restart always \
gitlab/gitlab-runner:latest gitlab/gitlab-runner:latest
``` ```
**Note**: you need to use the same method for mounting you data volume as you >**Note**:
did originally (`-v /srv/gitlab-runner/config:/etc/gitlab-runner` or `--volumes-from gitlab-runner`) you need to use the same method for mounting you data volume as you
did originally (`-v /srv/gitlab-runner/config:/etc/gitlab-runner` or
`--volumes-from gitlab-runner`).
## Installing trusted SSL server certificates ## Installing trusted SSL server certificates
......
...@@ -109,22 +109,8 @@ Here are the steps to install and configure GitLab Runner under FreeBSD: ...@@ -109,22 +109,8 @@ Here are the steps to install and configure GitLab Runner under FreeBSD:
```bash ```bash
sudo chmod +x /usr/local/etc/rc.d/gitlab_runner sudo chmod +x /usr/local/etc/rc.d/gitlab_runner
``` ```
1. Register the Runner (look into [runners documentation](https://docs.gitlab.com/ce/ci/runners/) to learn how to obtain a token):
```bash
sudo -u gitlab-runner -H /usr/local/bin/gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com):
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this runner:
[name]:
Please enter the gitlab-ci tags for this runner (comma separated):
Registering runner... succeeded
Please enter the executor: virtualbox, ssh, shell, parallels, docker, docker-ssh:
shell
Runner registered successfully. Feel free to start it, but if it\'s running already the config should be automatically reloaded!
```
1. [Register the Runner](../register/index.md)
1. Enable the `gitlab-runner` service and start it: 1. Enable the `gitlab-runner` service and start it:
```bash ```bash
......
# Manual installation and configuration on GNU/Linux # Manual installation and configuration on GNU/Linux
>**Note:** If you don't want to use a [deb/rpm repository](linux-repository.md) to install
GitLab Runner, or your GNU/Linux OS is not among the supported ones, you can
install it manually.
Make sure that you read the [FAQ](../faq/README.md) section which describes Make sure that you read the [FAQ](../faq/README.md) section which describes
some of the most common problems with GitLab Runner. some of the most common problems with GitLab Runner.
If you don't want to use a [deb/rpm repository](linux-repository.md) to install
GitLab Runner, or your OS is not among the supported ones, you can install it
manually.
## Install ## Install
Simply download one of the binaries for your system: 1. Simply download one of the binaries for your system:
```bash
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-386
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-arm
```
You can download a binary for every available version as described in
[Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release).
Give it permissions to execute: ```sh
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-386
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-arm
```
```bash You can download a binary for every available version as described in
sudo chmod +x /usr/local/bin/gitlab-runner [Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release).
```
Optionally, if you want to use Docker, install Docker with: 1. Give it permissions to execute:
```bash ```sh
curl -sSL https://get.docker.com/ | sh sudo chmod +x /usr/local/bin/gitlab-runner
``` ```
Create a GitLab CI user: 1. Optionally, if you want to use Docker, install Docker with:
``` ```sh
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash curl -sSL https://get.docker.com/ | sh
``` ```
Register the Runner (look into [Runners documentation](https://docs.gitlab.com/ce/ci/runners/) to learn how to obtain a token): 1. Create a GitLab CI user:
```bash ```sh
sudo gitlab-runner register sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
``` ```
Install and run as service: 1. [Register the Runner](../register/index.md)
1. Install and run as service:
```bash ```sh
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start sudo gitlab-runner start
``` ```
>**Note** >**Note**
If `gitlab-runner` is installed and run as service (what is described If `gitlab-runner` is installed and run as service (what is described
in this page), it will run as root, but will execute jobs as user specified by in this page), it will run as root, but will execute jobs as user specified by
the `install` command. This means that some of the job functions like cache and the `install` command. This means that some of the job functions like cache and
artifacts will need to execute `/usr/local/bin/gitlab-runner` command, artifacts will need to execute `/usr/local/bin/gitlab-runner` command,
therefore the user under which jobs are run, needs to have access to the executable. therefore the user under which jobs are run, needs to have access to the executable.
## Update ## Update
Stop the service (you need elevated command prompt as before): 1. Stop the service (you need elevated command prompt as before):
```bash ```sh
sudo gitlab-runner stop sudo gitlab-runner stop
``` ```
Download the binary to replace Runner's executable: 1. Download the binary to replace Runner's executable:
```bash ```sh
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-386 sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-386
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64 sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64
``` ```
You can download a binary for every available version as described in You can download a binary for every available version as described in
[Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release). [Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release).
Give it permissions to execute: 1. Give it permissions to execute:
```bash ```sh
sudo chmod +x /usr/local/bin/gitlab-runner sudo chmod +x /usr/local/bin/gitlab-runner
``` ```
Start the service: 1. Start the service:
```bash ```sh
sudo gitlab-runner start sudo gitlab-runner start
``` ```
...@@ -5,7 +5,7 @@ Currently we support: ...@@ -5,7 +5,7 @@ Currently we support:
- Debian - Debian
- Ubuntu - Ubuntu
- RHEL - RHEL
- CentOS. - CentOS
If you want to use the [Docker executor], install it before using the Runner: If you want to use the [Docker executor], install it before using the Runner:
...@@ -13,75 +13,60 @@ If you want to use the [Docker executor], install it before using the Runner: ...@@ -13,75 +13,60 @@ If you want to use the [Docker executor], install it before using the Runner:
curl -sSL https://get.docker.com/ | sh curl -sSL https://get.docker.com/ | sh
``` ```
## Add the repository ## Installing the Runner
Add GitLab's official repository: To install the Runner:
```bash 1. Add GitLab's official repository:
# For Debian/Ubuntu
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
# For RHEL/CentOS ```bash
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash # For Debian/Ubuntu
``` curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
>**Note:** # For RHEL/CentOS
_Debian users should use APT pinning_ curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
> ```
Since Debian Stretch, Debian maintainers added their native package
with the same name as is used by our package, and by default the official
repositories will have a higher priority.
>
If you want to use our package you should manually set the source of
the package. The best would be to add the pinning configuration file.
Thanks to this every next update of the Runner's package - whether it will
be done manually or automatically - will be done using the same source:
>
```bash
cat > /etc/apt/preferences.d/pin-gitlab-runner.pref <<EOF
Explanation: Prefer GitLab provided packages over the Debian native ones
Package: gitlab-ci-multi-runner
Pin: origin packages.gitlab.com
Pin-Priority: 1001
EOF
```
Install `gitlab-ci-multi-runner`: >**Note:**
_Debian users should use APT pinning_
>
Since Debian Stretch, Debian maintainers added their native package
with the same name as is used by our package, and by default the official
repositories will have a higher priority.
>
If you want to use our package you should manually set the source of
the package. The best would be to add the pinning configuration file.
Thanks to this every next update of the Runner's package - whether it will
be done manually or automatically - will be done using the same source:
>
```bash
cat > /etc/apt/preferences.d/pin-gitlab-runner.pref <<EOF
Explanation: Prefer GitLab provided packages over the Debian native ones
Package: gitlab-ci-multi-runner
Pin: origin packages.gitlab.com
Pin-Priority: 1001
EOF
```
```bash 1. Install `gitlab-ci-multi-runner`:
# For Debian/Ubuntu
sudo apt-get install gitlab-ci-multi-runner
# For RHEL/CentOS ```bash
sudo yum install gitlab-ci-multi-runner # For Debian/Ubuntu
``` sudo apt-get install gitlab-runner
Register the Runner (look into [Runners documentation](https://docs.gitlab.com/ce/ci/runners/) to learn how to obtain a token): # For RHEL/CentOS
sudo yum install gitlab-runner
```
```bash 1. [Register the Runner](../register/index.md)
sudo gitlab-ci-multi-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
docker
Please enter the Docker image (eg. ruby:2.1):
ruby:2.1
INFO[0037] Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!
```
The Runner should be started already and you are ready to build your projects! After completing the step above, he Runner should be started already being
ready to be used by your projects!
Make sure that you read the [FAQ](../faq/README.md) section which describes Make sure that you read the [FAQ](../faq/README.md) section which describes
some of the most common problems with GitLab Runner. some of the most common problems with GitLab Runner.
## Update ## Updating the Runner
Simply execute to install latest version: Simply execute to install latest version:
......
...@@ -22,26 +22,7 @@ download the macOS binary. ...@@ -22,26 +22,7 @@ download the macOS binary.
**The rest of commands execute as the user who will run the Runner.** **The rest of commands execute as the user who will run the Runner.**
1. Register the Runner (look into [Runners documentation](https://docs.gitlab.com/ce/ci/runners/) to learn how to obtain a token): 1. [Register the Runner](../register/index.md)
```bash
gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
Please enter the gitlab-ci token for this runner
xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
docker
Please enter the Docker image (eg. ruby:2.1):
ruby:2.1
INFO[0037] Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!
```
1. Install the Runner as service and start it: 1. Install the Runner as service and start it:
```bash ```bash
......
...@@ -8,39 +8,12 @@ To install and run GitLab Runner on Windows you need: ...@@ -8,39 +8,12 @@ To install and run GitLab Runner on Windows you need:
## Installation ## Installation
1. Create a folder somewhere in your system, ex.: `C:\GitLab-Runner`. 1. Create a folder somewhere in your system, ex.: `C:\GitLab-Runner`.
1. Download the binary for [x86][] or [amd64][] and put it into the folder you 1. Download the binary for [x86][] or [amd64][] and put it into the folder you
created. Rename the binary to `gitlab-runner.exe`. created. Rename the binary to `gitlab-runner.exe`.
You can download a binary for every available version as described in You can download a binary for every available version as described in
[Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release). [Bleeding Edge - download any other tagged release](bleeding-edge.md#download-any-other-tagged-release).
1. Run an [`Administrator`/elevated command prompt][prompt] (<kbd>WindowsKey</kbd> + <kbd>X</kbd> then select Command Prompt (Admin)). 1. Run an [`Administrator`/elevated command prompt][prompt] (<kbd>WindowsKey</kbd> + <kbd>X</kbd> then select Command Prompt (Admin)).
1. [Register the Runner](../register/index.md).
1. Register the Runner (see [Runners documentation](https://docs.gitlab.com/ce/ci/runners/) to learn how to obtain a token):
```bash
C:\Windows\system32>cd C:\GitLab-Runner
C:\GitLab-Runner>gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
https://gitlab.com
Please enter the gitlab-ci token for this runner:
xxxx
Please enter the gitlab-ci description for this runner:
[xxxx]:
Please enter the gitlab-ci tags for this runner (comma separated):
windows
Whether to run untagged builds [true/false]:
[false]: true
Registering runner... succeeded
Please enter the executor: docker+machine, kubernetes, docker, docker-ssh, parallels, virtualbox, shell, ssh, docker-ssh+machine:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
```
If you'd like to register multiple Runners on the same machine with different
configurations repeat the `gitlab-runner register` command.
1. Install the Runner as a service and start it. You can either run the service 1. Install the Runner as a service and start it. You can either run the service
using the Built-in System Account (recommended) or using a user account. using the Built-in System Account (recommended) or using a user account.
......
# Registering Runners
Registering a Runner is the process that binds the Runner with a GitLab instance.
## Prerequisites
Before registering a Runner, you need to first:
- [Install it](../install/index.md) on a server separate than where GitLab
is installed on
- [Obtain a token](https://docs.gitlab.com/ce/ci/runners/) for a shared or
specific Runner via GitLab's interface
## GNU/Linux
To register a Runner under GNU/Linux:
1. Run the following command:
```sh
sudo gitlab-runner register
```
1. Enter your GitLab instance URL:
```
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
```
1. Enter the token you obtained to register the Runner:
```
Please enter the gitlab-ci token for this runner
xxx
```
1. Enter a description for the Runner, you can change this later in GitLab's
UI:
```
Please enter the gitlab-ci description for this runner
[hostame] my-runner
```
1. Enter the [tags associated with the Runner][tags], you can change this later in GitLab's UI:
```
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
```
1. Choose whether the Runner should pick up jobs that do not [have tags][tags],
you can change this later in GitLab's UI (defaults to false):
```
Whether to run untagged jobs [true/false]:
[false]: true
```
1. Choose whether to lock the Runner to the current project, you can change
this later in GitLab's UI. Useful when the Runner is specific (defaults to
false):
```
Whether to lock Runner to current project [true/false]:
[false]: false
```
1. Enter the [Runner executor](../executors/README.md):
```
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker
```
1. If you chose Docker as your executor, you'll be asked for the default
image to be used for projects that do not define one in `.gitlab-ci.yml`:
```
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
```
## macOS
To register a Runner under macOS:
1. Run the following command:
```sh
gitlab-runner register
```
1. Enter your GitLab instance URL:
```
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
```
1. Enter the token you obtained to register the Runner:
```
Please enter the gitlab-ci token for this runner
xxx
```
1. Enter a description for the Runner, you can change this later in GitLab's
UI:
```
Please enter the gitlab-ci description for this runner
[hostame] my-runner
```
1. Enter the [tags associated with the Runner][tags], you can change this later in GitLab's UI:
```
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
```
1. Choose whether the Runner should pick up jobs that do not [have tags][tags],
you can change this later in GitLab's UI (defaults to false):
```
Whether to run untagged jobs [true/false]:
[false]: true
```
1. Choose whether to lock the Runner to the current project, you can change
this later in GitLab's UI. Useful when the Runner is specific (defaults to
false):
```
Whether to lock Runner to current project [true/false]:
[false]: false
```
1. Enter the [Runner executor](../executors/README.md):
```
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker
```
1. If you chose Docker as your executor, you'll be asked for the default
image to be used for projects that do not define one in `.gitlab-ci.yml`:
```
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
```
## Windows
To register a Runner under Windows:
1. Run the following command:
```sh
./gitlab-runner.exe register
```
1. Enter your GitLab instance URL:
```
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
```
1. Enter the token you obtained to register the Runner:
```
Please enter the gitlab-ci token for this runner
xxx
```
1. Enter a description for the Runner, you can change this later in GitLab's
UI:
```
Please enter the gitlab-ci description for this runner
[hostame] my-runner
```
1. Enter the [tags associated with the Runner][tags], you can change this later in GitLab's UI:
```
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
```
1. Choose whether the Runner should pick up jobs that do not [have tags][tags],
you can change this later in GitLab's UI (defaults to false):
```
Whether to run untagged jobs [true/false]:
[false]: true
```
1. Choose whether to lock the Runner to the current project, you can change
this later in GitLab's UI. Useful when the Runner is specific (defaults to
false):
```
Whether to lock Runner to current project [true/false]:
[false]: false
```
1. Enter the [Runner executor](../executors/README.md):
```
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker
```
1. If you chose Docker as your executor, you'll be asked for the default
image to be used for projects that do not define one in `.gitlab-ci.yml`:
```
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
```
If you'd like to register multiple Runners on the same machine with different
configurations repeat the `./gitlab-runner.exe register` command.
## FreeBSD
To register a Runner under FreeBSD:
1. Run the following command:
```sh
sudo -u gitlab-runner -H /usr/local/bin/gitlab-runner register
```
1. Enter your GitLab instance URL:
```
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
```
1. Enter the token you obtained to register the Runner:
```
Please enter the gitlab-ci token for this runner
xxx
```
1. Enter a description for the Runner, you can change this later in GitLab's
UI:
```
Please enter the gitlab-ci description for this runner
[hostame] my-runner
```
1. Enter the [tags associated with the Runner][tags], you can change this later in GitLab's UI:
```
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
```
1. Choose whether the Runner should pick up jobs that do not [have tags][tags],
you can change this later in GitLab's UI (defaults to false):
```
Whether to run untagged jobs [true/false]:
[false]: true
```
1. Choose whether to lock the Runner to the current project, you can change
this later in GitLab's UI. Useful when the Runner is specific (defaults to
false):
```
Whether to lock Runner to current project [true/false]:
[false]: false
```
1. Enter the [Runner executor](../executors/README.md):
```
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker
```
1. If you chose Docker as your executor, you'll be asked for the default
image to be used for projects that do not define one in `.gitlab-ci.yml`:
```
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
```
## Docker
To register a Runner using a Docker container:
1. Run the following command:
```sh
docker exec -it gitlab-runner gitlab-runner register
```
1. Enter your GitLab instance URL:
```
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
```
1. Enter the token you obtained to register the Runner:
```
Please enter the gitlab-ci token for this runner
xxx
```
1. Enter a description for the Runner, you can change this later in GitLab's
UI:
```
Please enter the gitlab-ci description for this runner
[hostame] my-runner
```
1. Enter the [tags associated with the Runner][tags], you can change this later in GitLab's UI:
```
Please enter the gitlab-ci tags for this runner (comma separated):
my-tag,another-tag
```
1. Choose whether the Runner should pick up jobs that do not [have tags][tags],
you can change this later in GitLab's UI (defaults to false):
```
Whether to run untagged jobs [true/false]:
[false]: true
```
1. Choose whether to lock the Runner to the current project, you can change
this later in GitLab's UI. Useful when the Runner is specific (defaults to
false):
```
Whether to lock Runner to current project [true/false]:
[false]: false
```
1. Enter the [Runner executor](../executors/README.md):
```
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:
docker
```
1. If you chose Docker as your executor, you'll be asked for the default
image to be used for projects that do not define one in `.gitlab-ci.yml`:
```
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
```
[tags]: https://docs.gitlab.com/ce/ci/runners/#using-tags
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment