docker-maven-plugin
docker-maven-plugin copied to clipboard
Host address and port available inside container
I have a container which needs to know its external address and port, so that it can publish that to another container that calls back to the first container. (Yes, complicated. I didn't write it.) It seemed that I might be able to do
<env>
<KAFKA_ADVERTISED_HOST_NAME>${docker.containers.kafka.ports.9092/tcp.host}</KAFKA_ADVERTISED_HOST_NAME>
<KAFKA_ADVERTISED_PORT>${docker.containers.kafka.ports.9092/tcp.port}</KAFKA_ADVERTISED_PORT>
</env>
However, those environment variables end up having a value of null
inside the container, so I am guessing that the properties are not set by the time the are evaluated. Is there a way to do this?