Assing random public port to container using remote api

Hi

I’m trying to create a docker container with random public ports by remote api. I already tried to set PublishAllPorts property to true, and HostPort to empty string. I’m using 1.24 API version.

Does anyone know how to do it?