public function requiredPorts()
    {
        $ports = [];

        foreach ($this->getServiceInstances() as $info) {
            if (!isset($info['instance'])) {
                continue;
            }
            $instance = $info['instance'];

            if ($instance instanceof ServiceInterface) {
                $ports = array_merge($ports, $instance->getHostPorts());
            }
        }
        $ports = array_unique($ports);

        return array_values($ports);
    }