Skip to content

Host address and port available inside container #119

Description

@udalrich

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions