Pass container hostname to other containers

Hi all,

I’m absolutely new to Drone and started using it for a research project recently.

For an integration testing approach I need to start an ActiveMQ broker and connect some other components to it.
I managed to start a broker in detach mode (using the rmohr/activemq image).
However, there is still the problem that the hostname of this container changes everytime the pipeline is triggered. So other components can’t connect to it.

Is there a way in which I can pass the current hostname / IP to the other components (that each run in their own (drone) docker containers?
Or is there any way to set the hostname to a fixed one via Drone?

Thanks in advance!

you can access a container using the step name as the hostname. Drone uses hostname aliases to achieve this, which means each container has multiple hostnames (a random hostname, and a user-friendly hostname). We have a bunch of examples you can reference at https://docs.drone.io/pipeline/docker/examples/

1 Like