Communicate between two containers in Google cloud build

后端 未结 3 1222
醉话见心
醉话见心 2021-02-04 08:20

I am running my CI/CD pipeline in Google cloud build. My app has web and wget containers. I am trying to reach web from wget<

3条回答
  •  时光说笑
    2021-02-04 08:34

    I had a similar issue setting up integration tests on cloud build. I was trying to run integration tests from another builder (go-builder) against my other containers (started through docker-compose community built containers).

    Without specifying any networks on docker-compose.yaml, all containers are started on the default network (https://docs.docker.com/compose/networking/). On cloud build, it creates a new network named cloudbuild_default and places all my containers there. By forcing all containers to join cloudbuild network through my docker-compose.yaml file, I was able to establish communications and run my tests against them.

    #docker-compose.yaml
    
    networks:
      default:
        external:
          name: cloudbuild
    

    This might be an alternate configuration for you. Hope it helps

提交回复
热议问题