Commit 4e6053bd authored by Pedro Pombeiro's avatar Pedro Pombeiro Committed by Suzanne Selhorn

Remove support for --docker-services flag on register command

Related to https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/2036
parent 1d2259fd
...@@ -26,7 +26,20 @@ test them on a dedicated CI server. ...@@ -26,7 +26,20 @@ test them on a dedicated CI server.
To use GitLab Runner with Docker you need to [register a new Runner](https://docs.gitlab.com/runner/register/) To use GitLab Runner with Docker you need to [register a new Runner](https://docs.gitlab.com/runner/register/)
to use the `docker` executor. to use the `docker` executor.
A one-line example can be seen below: An example can be seen below. First we set up a temporary template to supply the services:
```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "postgres:latest"
[[runners.docker.services]]
name = "mysql:latest"
EOF
```
Then we register the runner using the template that was just created:
```shell ```shell
sudo gitlab-runner register \ sudo gitlab-runner register \
...@@ -34,9 +47,8 @@ sudo gitlab-runner register \ ...@@ -34,9 +47,8 @@ sudo gitlab-runner register \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "docker-ruby:2.6" \ --description "docker-ruby:2.6" \
--executor "docker" \ --executor "docker" \
--docker-image ruby:2.6 \ --template-config /tmp/test-config.template.toml \
--docker-services postgres:latest \ --docker-image ruby:2.6
--docker-services mysql:latest
``` ```
The registered runner will use the `ruby:2.6` Docker image and will run two The registered runner will use the `ruby:2.6` Docker image and will run two
......
...@@ -76,14 +76,21 @@ To build this project you also need to have [GitLab Runner](https://docs.gitlab. ...@@ -76,14 +76,21 @@ To build this project you also need to have [GitLab Runner](https://docs.gitlab.
You can use public runners available on `gitlab.com` or you can register your own: You can use public runners available on `gitlab.com` or you can register your own:
```shell ```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "postgres:latest"
EOF
gitlab-runner register \ gitlab-runner register \
--non-interactive \ --non-interactive \
--url "https://gitlab.com/" \ --url "https://gitlab.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "python-3.5" \ --description "python-3.5" \
--executor "docker" \ --executor "docker" \
--docker-image python:3.5 \ --template-config /tmp/test-config.template.toml \
--docker-services postgres:latest --docker-image python:3.5
``` ```
With the command above, you create a runner that uses the [`python:3.5`](https://hub.docker.com/_/python) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database. With the command above, you create a runner that uses the [`python:3.5`](https://hub.docker.com/_/python) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database.
......
...@@ -64,7 +64,19 @@ You can do this through the [Heroku Dashboard](https://dashboard.heroku.com/). ...@@ -64,7 +64,19 @@ You can do this through the [Heroku Dashboard](https://dashboard.heroku.com/).
First install [Docker Engine](https://docs.docker.com/installation/). First install [Docker Engine](https://docs.docker.com/installation/).
To build this project you also need to have [GitLab Runner](https://docs.gitlab.com/runner/). To build this project you also need to have [GitLab Runner](https://docs.gitlab.com/runner/).
You can use public runners available on `gitlab.com` or register your own: You can use public runners available on `gitlab.com` or register your own. Start by
creating a template configuration file in order to pass complex configuration:
```shell
cat > /tmp/test-config.template.toml << EOF
[[runners]]
[runners.docker]
[[runners.docker.services]]
name = "mysql:latest"
EOF
```
Finally, register the runner, passing the newly-created template configuration file:
```shell ```shell
gitlab-runner register \ gitlab-runner register \
...@@ -73,8 +85,8 @@ gitlab-runner register \ ...@@ -73,8 +85,8 @@ gitlab-runner register \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "ruby:2.6" \ --description "ruby:2.6" \
--executor "docker" \ --executor "docker" \
--docker-image ruby:2.6 \ --template-config /tmp/test-config.template.toml \
--docker-services latest --docker-image ruby:2.6
``` ```
With the command above, you create a Runner that uses the [`ruby:2.6`](https://hub.docker.com/_/ruby) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database. With the command above, you create a Runner that uses the [`ruby:2.6`](https://hub.docker.com/_/ruby) image and uses a [PostgreSQL](https://hub.docker.com/_/postgres) database.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment