Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Services in Gitlab-ci start with error "host type networking can't be used with links"

I have a couple services in my .gitlab-ci.yml that I need to start in order to run some tests.

services:
- name: bitnami/rabbitmq:3.8.9
  alias: rabbitmq
- name: postgres:latest
  alias: postgres
- name: milvusdb/milvus:cpu-latest
  alias: milvus

When the pipe line runs I get the following errors about regarding "host type networking can't be used with links" and then my tests are unable to connect to theses services. Any ideas?

Starting service bitnami/rabbitmq:3.8.9 ...
Pulling docker image bitnami/rabbitmq:3.8.9 ...
Using docker image sha256:05842c6800e806410cf801b2953405471944e371d3891c99c5c85b1d65213081 for bitnami/rabbitmq:3.8.9 with digest bitnami/rabbitmq@sha256:e11436ff83c3ede1aeb909fa398fb93990b00f66d8f8ee789334799546551429 ...
Starting service postgres:latest ...
Pulling docker image postgres:latest ...
Using docker image sha256:88590756b1243dbb10fdf02ffc837cd6cbc5a98b8b7aca90dc42172bd35d2ab4 for postgres:latest with digest postgres@sha256:b25265ac1dfa19224fd47dd9f5744aa177248fd64e89f407446559cc7dbc7a23 ...
WARNING: Service postgres:latest is already created. Ignoring.
Starting service milvusdb/milvus:cpu-latest ...
Pulling docker image milvusdb/milvus:cpu-latest ...
Using docker image sha256:de52c89600581e203bc83f0dd984133da75fedbcb254c45cee746695f4f8d1ef for milvusdb/milvus:cpu-latest with digest milvusdb/milvus@sha256:0f2609e575edeea8cafa8525ac8a94ed1da7f3048f938cafa8832be60fbbc25d ...
Waiting for services to be up and running...
*** WARNING: Service runner-rugbzglx-project-101-concurrent-0-65c54561e0ef98bc-milvusdb__milvus-2 probably didn't start properly.
Health check error:
create service container: Error response from daemon: conflicting options: host type networking can't be used with links. This would result in undefined behavior (docker.go:1230:0s)
Service container logs:
*********
*** WARNING: Service runner-rugbzglx-project-101-concurrent-0-65c54561e0ef98bc-bitnami__rabbitmq-0 probably didn't start properly.
Health check error:
create service container: Error response from daemon: conflicting options: host type networking can't be used with links. This would result in undefined behavior (docker.go:1230:0s)
Service container logs:
2021-04-01T16:32:59.685554437Z rabbitmq 16:32:59.68 
2021-04-01T16:32:59.688810064Z rabbitmq 16:32:59.68 Welcome to the Bitnami rabbitmq container
2021-04-01T16:32:59.692027343Z rabbitmq 16:32:59.69 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-rabbitmq
2021-04-01T16:32:59.695625938Z rabbitmq 16:32:59.69 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-rabbitmq/issues
2021-04-01T16:32:59.699195720Z rabbitmq 16:32:59.69 
2021-04-01T16:32:59.703053245Z rabbitmq 16:32:59.70 INFO  ==> ** Starting RabbitMQ setup **
2021-04-01T16:32:59.734132004Z rabbitmq 16:32:59.73 INFO  ==> Validating settings in RABBITMQ_* env vars..
2021-04-01T16:32:59.768512663Z rabbitmq 16:32:59.76 INFO  ==> Initializing RabbitMQ...
2021-04-01T16:32:59.791219983Z rabbitmq 16:32:59.78 INFO  ==> Generating random cookie
2021-04-01T16:32:59.831062410Z rabbitmq 16:32:59.83 INFO  ==> Starting RabbitMQ in background...
*********
*** WARNING: Service runner-rugbzglx-project-101-concurrent-0-65c54561e0ef98bc-postgres-1 probably didn't start properly.
Health check error:
create service container: Error response from daemon: conflicting options: host type networking can't be used with links. This would result in undefined behavior (docker.go:1230:0s)
Service container logs:
2021-04-01T16:33:01.060049843Z Error: Database is uninitialized and superuser password is not specified.
2021-04-01T16:33:01.060137811Z        You must specify POSTGRES_PASSWORD to a non-empty value for the
2021-04-01T16:33:01.060150522Z        superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
2021-04-01T16:33:01.060158849Z 
2021-04-01T16:33:01.060165847Z        You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
2021-04-01T16:33:01.060195247Z        connections without a password. This is *not* recommended.
2021-04-01T16:33:01.060202850Z 
2021-04-01T16:33:01.060209698Z        See PostgreSQL documentation about "trust":
2021-04-01T16:33:01.060217076Z        https://www.postgresql.org/docs/current/auth-trust.html
*********
like image 510
Bigred11 Avatar asked Nov 29 '25 18:11

Bigred11


1 Answers

The solution is to change network_mode in config.toml configuration file of runner.

[[runners]]
  name="myrunner"
  [[runners.docker]]
    network_mode="host"

You can delete this line(network_mode="host") and docker will use bridge mode by default.

like image 55
cute ninja Avatar answered Dec 04 '25 20:12

cute ninja