docker service alias
Description
In the case a project is developed in a docker environment, it may references other containers using default names (e.g. "database"). Preparing an alternative configuration for CI might become quite tedious and a waste of time. Moreover, gitlab-ci way of naming services sometimes causes other problems (see related issue), especially when using private registries, since the registry hostname is included in the service name.
Allowing to specify an alias for the services would allow to fix these issues.
Proposal
To avoid introducing a BC, the current service name aliasing must be kept as is:
registry.example.dot/some/image:tag
=> registry.example.dot__some__image
A second, compatible service format could be allowed: alias=image:tag
, e.g.:
database=registry.example.dot/some/image:tag
=> database
The resulting format could be summarized by: [alias=]image[:tag]
.
I thought about using a colon for the alias part but it would be ambiguous: would a:b
mean image a
with tag b
or image b
aliased as a
? So I went for the equal sign.
Links to related issues and merge requests / references
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1628