private void resolveHostname(String envVar) {
        String hostnameExternalReason;
        if (getEnvMap().containsKey(envVar)) {
            // do nothing
            hostnameExternalReason = "explicitly as environment variable";
        } else if (getNetwork() != null && getNetworkAliases() != null && getNetworkAliases().size() >= 1) {
            withEnv(envVar, getNetworkAliases().get(getNetworkAliases().size() - 1)); // use the last network alias set
            hostnameExternalReason = "to match last network alias on container with non-default network";
        } else {
            withEnv(envVar, getHost());
            hostnameExternalReason = "to match host-routable address for container";
        }

        logger()
            .info("{} environment variable set to {} ({})", envVar, getEnvMap().get(envVar), hostnameExternalReason);
    }
Provides a docker argument string including all default labels set on testcontainers containers (excluding reuse labels)
@return Argument string in the format `-l key1=value1 -l key2=value2`
modules/localstack/src/main/java/org/testcontainers/containers/localstack/LocalStackContainer.java