Im using 2 containers on my Ubuntu OS: Gitlab-ce and gitlab-runner
Containers names are: gitlab_gitlab_1 and gitlab_gitlab-runner_1
I
Thanks to Tarun Lalwan link and according to Joyce Babu post, there are an undocumented option from the gitlab runner repos in the
[runners.docker] section
network_mode : Add container to a custom network
So I have to set this option with my network name in the config.toml like
[[runners]]
...
[runners.docker]
...
network_mode = "gitlab_default"
OR when create the runner from command line
docker exec -it gitlab_gitlab-runner_1 gitlab-runner register \
--non-interactive \
--url http://gitlab_gitlab_1 \
--registration-token _wgMgEx3nBocYQtoi83c \
--executor docker \
--docker-image alpine:latest \
--docker-network-mode gitlab_default