ports property

Map<int, int?> get ports

Port map: container port → optional host port.

A null host port value requests an ephemeral port from the OS. Read-only view. Use withBindPorts and withExposedPorts to add entries.

Implementation

Map<int, int?> get ports => Map.unmodifiable(_ports);