summaryrefslogtreecommitdiff
path: root/doc/docker/using_docker_images.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/docker/using_docker_images.md')
-rw-r--r--doc/docker/using_docker_images.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/docker/using_docker_images.md b/doc/docker/using_docker_images.md
index a88bb62..9170783 100644
--- a/doc/docker/using_docker_images.md
+++ b/doc/docker/using_docker_images.md
@@ -66,6 +66,39 @@ Alias hostname for the service is made from the image name:
1. Everything after `:` is stripped,
2. '/' is replaced to `_`.
+### Configuring services
+Many services accepts environment variables, thus allowing to change database name or set account name.
+
+GitLab Runner with version equal or greater than 0.5.0 passes all YAML-defined variables to created service containers.
+
+1. To configure database name for [postgres](https://registry.hub.docker.com/u/library/postgres/) service,
+you need to set POSTGRES_DB.
+
+ ```yaml
+ services:
+ - postgres
+
+ variables:
+ POSTGRES_DB: gitlab
+ ```
+
+1. To use [mysql](https://registry.hub.docker.com/u/library/mysql/) service with empty password for time of build,
+you need to set MYSQL_ALLOW_EMPTY_PASSWORD.
+
+ ```yaml
+ services:
+ - mysql
+
+ variables:
+ MYSQL_ALLOW_EMPTY_PASSWORD: yes
+ ```
+
+For more possible configuration variables check the
+https://registry.hub.docker.com/u/library/mysql/ or https://registry.hub.docker.com/u/library/postgres/
+or README page for any other Docker image.
+
+**Note: All variables will passed to all service containers. It's not designed to distinguish which variable should go where.**
+
### Overwrite image and services
It's possible to overwrite `docker-image` and specify services from `.gitlab-ci.yml`.
If you add to your YAML the `image` and the `services` these parameters