Gitlab CI runner not able to expose ports of nested Docker containers

前端 未结 4 1192
不知归路
不知归路 2020-12-15 17:28

When using GitLab CI, as well as the gitlab-ci-multi-runner, I\'m unable to get internally-started Docker containers to expose their ports to the \"host\", whic

4条回答
  •  猫巷女王i
    2020-12-15 18:04

    The offical gitab-ci on gitlab.com documentation refers to the example of PostgreSQL

    Its working CI does not try to connect to localhost, but rather to the service name

    The services keyword defines just another docker image that is run during your build and is linked to the docker image that the image keyword defines. This allows you to access the service image during build time.

    The service container for MySQL will be accessible under the hostname mysql.
    So, in order to access your database service you have to connect to the host named mysql instead of a socket or localhost.

    You could check if this applies in your case, and try accessing your application service in app:9143 instead of localhost:9143.

提交回复
热议问题