[Local Builds] Connect from Circle CI container to host machine


#1

Is there any way to connect from locally builds container to host machines’ port, e.g. DB like PostgreSQL or Search Engine like Elasticsearch?

Example

config.yml

jobs:
  build:
    docker: 
      - image: ruby:2.3.1 # here is the primary container here

  run:
    name: Health check to PostgreSQL from primary_container
    command: |
      nc -vz ${HOST_MACHINE_IP} ${HOST_MACHINE_PORT}

Why

Because local builds consumes too much CPU and takes too long if you use some sub containers for middle-wares along with the primary container.

Therefore, I would like to know a realistic way to run local builds ( I sometimes run it locally to debug some tests which only fails on CI only).


#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.