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

前端 未结 4 1154
不知归路
不知归路 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条回答
  •  独厮守ぢ
    2020-12-15 17:49

    When using docker:dind a container is created and your docker-compose containers get setup within it. It exposes the ports to localhost within the docker:dind container. You cannot access this as localhost from the environment that your code is executing in.

    A hostname of docker is setup for you to reference this docker:dind container. You can check by using cat /etc/hosts.

    Instead of referencing localhost:9143 you should use docker:9143.

提交回复
热议问题