Skip to content

Services don't work when network_mode set to a custom bridge network

Zendesk: https://gitlab.zendesk.com/agent/tickets/81598

Steps to reproduce:

  1. Create a new Docker bridged network: docker network create test
  2. Configure Runner to use this network by adding network_mode = "test" to config.toml
  3. Use a .gitlab-ci.yml that looks something like:
image: ubuntu:16.04
services:
  - nginx

pages:
  script:
  - apt install curl
  - curl http://nginx:80

Essentially what happens is the service container fails to start properly:

Running with gitlab-ci-multi-runner 9.5.0 (413da38)
  on stanhu2 Docker (a96c6255)
Using Docker executor with image ubuntu:16.04 ...
Starting service nginx:latest ...
Pulling docker image nginx:latest ...
Using docker image nginx:latest ID=sha256:b8efb18f159bd948486f18bd8940b56fd2298b438229f5bd2bcf4cedcf037448 for nginx service...
Waiting for services to be up and running...

*** WARNING: Service runner-a96c6255-project-146-concurrent-0-nginx-0 probably didn't start properly.

exit code 1

*********
Edited by Stan Hu