You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to dynamically assign a random port to a container upon its creation. I've been experimenting with various configurations, including setting the PortBindings property to null and trying different values for HostPort such as 0, null, an empty string, and "0". However, I haven't been successful in achieving the desired outcome. Here's the snippet of code I've been working with:
var portBindings = new Dictionary<string, IList<PortBinding>>();
var exposedPorts = new Dictionary<string, EmptyStruct>();
portBindings.Add($"{hostport}/tcp", new List<PortBinding> { new() { HostPort = port.ToString() } });
exposedPorts.Add($"{port}/tcp", default);
I'm attempting to dynamically assign a random port to a container upon its creation. I've been experimenting with various configurations, including setting the PortBindings property to null and trying different values for HostPort such as 0, null, an empty string, and "0". However, I haven't been successful in achieving the desired outcome. Here's the snippet of code I've been working with:
The text was updated successfully, but these errors were encountered: