private void addPortBindings(CommandInput input,PortBinding[] portBindings){
  Map<String,Map<String,String>> exposedPortsMap=new HashMap<>();
  input.withProperty(DOCKER_CONTAINER_EXPOSED_PORTS_PROP_NAME,exposedPortsMap);
  Map<String,Object> hostConfig=getOrAddMap(input,DOCKER_CONTAINER_HOST_CONFIG_PROP_NAME);
  Map<String,List<Map<String,String>>> portBindingsMap=new HashMap<>();
  hostConfig.put(DOCKER_CONTAINER_PORT_BINDINGS_PROP_NAME,portBindingsMap);
  for (  PortBinding portBinding : portBindings) {
    exposedPortsMap.put(portBinding.containerPort,Collections.emptyMap());
    DockerPortMapping mapping=DockerPortMapping.fromString(portBinding.toString());
    Map<String,List<Map<String,String>>> portDetails=mapping.toMap();
    portBindingsMap.putAll(portDetails);
  }
}

private void addPortBindings ( CommandInput input , PortBinding [ ] portBindings ) { Map < String , Map < String , String > > exposedPortsMap = new HashMap < > ( ) ; input . withProperty ( DOCKER_CONTAINER_EXPOSED_PORTS_PROP_NAME , exposedPortsMap ) ; Map < String , Object > hostConfig = getOrAddMap ( input , DOCKER_CONTAINER_HOST_CONFIG_PROP_NAME ) ; Map < String , List < Map < String , String > > > portBindingsMap = new HashMap < > ( ) ; hostConfig . put ( DOCKER_CONTAINER_PORT_BINDINGS_PROP_NAME , portBindingsMap ) ; for ( PortBinding portBinding : portBindings ) { exposedPortsMap . put ( portBinding . containerPort , Collections . emptyMap ( ) ) ; DockerPortMapping mapping = DockerPortMapping . fromString ( portBinding . toString ( ) ) ; Map < String , List < Map < String , String > > > portDetails = mapping . toMap ( ) ; portBindingsMap . putAll ( portDetails ) ; } }
map port binding to exposedports and portbinding exposedports are only used by the api adapter , as the docker cli will add that itself
