private int getExternalPort(final int defaultValue) {
    return Optional.ofNullable(System.getenv(PORT_MAPPING_TAG + defaultValue))
        .map(Integer::valueOf)
        .orElse(defaultValue);
  }
Instantiates a new Docker nat manager.

@param ipDetector the ip detector
@param advertisedHost the advertised host
@param p2pPort the p 2 p port
@param rpcHttpPort the rpc http port
nat/src/main/java/org/hyperledger/besu/nat/docker/DockerNatManager.java