How to access API provided by primary container?

docker
api
circle.yml

#1

I have primary container (circleci/node:4.8.3) that runs some daemon and runs HTTP API at port 3000. Daemon spins up another worker containers that needs to communicate with that API.

How to implement this?

My guess is that I have to create new Dockerfile for primary container based on circleci/node:4.8.3 with EXPOSE 3000 added. Then in .circleci/config.yml use ifconfig to get IP address of primary container and provide it to worker containers?

Thanks!


#2

Hi there,

Containers in a job share the same localhost interface, so the ifconfig step won’t be necessary. This is assuming that you’re using the Docker executor without a remote engine. If you have a more complicated setup, can you create a support ticket (or use your coworker’s current open support ticket).

Regards,
Eric


#3

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