Commit ab3fb00c authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'registry-example' into 'master'

Update CI Docker docs

## What does this MR do?

Updates documentation with:

* instructions for bind-mounting for docker runners (fixes #17769 and #13898)
* examples of using the GitLab Container Registry in docker-based builds (fixes #17968 and #17967)
* update runner instructions for `gitlab-ci-multi-runner` (fixes https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1337)
* some grammar fixes

## Are there points in the code the reviewer needs to double check?

The markdown in general. The runner commands. I haven't been able to verify the socket version works yet.

## Why was this MR needed?

Better documentation for users.

## What are the relevant issue numbers?
#17769, #13898, #17968, #17967 

## Screenshots (if relevant)

See merge request !4524
parents 47cdb699 6ed7fcad
This diff is collapsed.
...@@ -23,7 +23,7 @@ To use GitLab Runner with docker you need to register a new runner to use the ...@@ -23,7 +23,7 @@ To use GitLab Runner with docker you need to register a new runner to use the
`docker` executor: `docker` executor:
```bash ```bash
gitlab-runner register \ gitlab-ci-multi-runner register \
--url "https://gitlab.com/" \ --url "https://gitlab.com/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "docker-ruby-2.1" \ --description "docker-ruby-2.1" \
......
...@@ -263,10 +263,10 @@ terminal execute: ...@@ -263,10 +263,10 @@ terminal execute:
```bash ```bash
# Check using docker executor # Check using docker executor
gitlab-runner exec docker test:app gitlab-ci-multi-runner exec docker test:app
# Check using shell executor # Check using shell executor
gitlab-runner exec shell test:app gitlab-ci-multi-runner exec shell test:app
``` ```
## Example project ## Example project
......
...@@ -63,10 +63,10 @@ instance. ...@@ -63,10 +63,10 @@ instance.
Now simply register the runner as any runner: Now simply register the runner as any runner:
``` ```
sudo gitlab-runner register sudo gitlab-ci-multi-runner register
``` ```
Shared runners are enabled by default as of GitLab 8.2, but can be disabled with the Shared runners are enabled by default as of GitLab 8.2, but can be disabled with the
`DISABLE SHARED RUNNERS` button. Previous versions of GitLab defaulted shared runners to `DISABLE SHARED RUNNERS` button. Previous versions of GitLab defaulted shared runners to
disabled. disabled.
...@@ -93,7 +93,7 @@ setup a specific runner for this project. ...@@ -93,7 +93,7 @@ setup a specific runner for this project.
To register the runner, run the command below and follow instructions: To register the runner, run the command below and follow instructions:
``` ```
sudo gitlab-runner register sudo gitlab-ci-multi-runner register
``` ```
### Making an existing Shared Runner Specific ### Making an existing Shared Runner Specific
......
...@@ -79,27 +79,8 @@ delete them. ...@@ -79,27 +79,8 @@ delete them.
This feature requires GitLab 8.8 and GitLab Runner 1.2. This feature requires GitLab 8.8 and GitLab Runner 1.2.
Make sure that your GitLab Runner is configured to allow building docker images. Make sure that your GitLab Runner is configured to allow building docker images.
You have to check the [Using Docker Build documentation](../../ci/docker/using_docker_build.md). You have to check the [Using Docker Build documentation](../ci/docker/using_docker_build.md).
Then see the CI documentation on [Using the GitLab Container Registry](../ci/docker/using_docker_build.md#using-the-gitlab-container-registry).
You can use [docker:dind](https://hub.docker.com/_/docker/) to build your images,
and this is how `.gitlab-ci.yml` should look like:
```
build_image:
image: docker:git
services:
- docker:dind
stage: build
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.example.com
- docker build -t registry.example.com/group/project:latest .
- docker push registry.example.com/group/project:latest
```
You have to use the credentials of the special `gitlab-ci-token` user with its
password stored in `$CI_BUILD_TOKEN` in order to push to the Registry connected
to your project. This allows you to automated building and deployment of your
Docker images.
## Limitations ## Limitations
......
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