(self)
return True
TCP/UDP ports < 1024 in ExposedPorts JSON metadata
        The exposed ports format is  ExposedPorts:{ "80/tcp":{}, }
TCP/UDP ports < 1024 in ExposedPorts JSON metadata
        The exposed ports format is  ExposedPorts:{ "80/tcp":{}, }
TCP / UDP ports < 1024 in ExposedPorts JSON metadata The exposed ports format is ExposedPorts : { 80 / tcp : {} }
def _check_exposed_ports(self):
        """TCP/UDP ports < 1024 in ExposedPorts JSON metadata
        The exposed ports format is  ExposedPorts:{ "80/tcp":{}, }
        """
        mapped_ports = self._get_portsmap()
        exposes_priv = False
        exposes_port = False
        for port in self.opt["portsexp"]:
            try:
                port_number = int(port.split("/")[0])
                exposes_port = True
            except (ValueError, TypeError):
                pass
            else:
                if port_number < 1024:
                    if port_number in list(mapped_ports.keys()):
                        if mapped_ports[port_number] >= 1024:
                            continue
                    exposes_priv = True
        if exposes_priv and HostInfo.uid != 0:
            Msg().err("Error: this container exposes privileged TCP/IP ports")
            return False
        if exposes_port:
            Msg().out("Warning: this container exposes TCP/IP ports", l=Msg.WAR)
        return True
def _check_exposed_ports ( self ) : mapped_ports = self . _get_portsmap ( ) exposes_priv = False exposes_port = False for port in self . opt [ "portsexp" ] : try : port_number = int ( port . split ( "/" ) [ 0 ] ) exposes_port = True except ( ValueError , TypeError ) : pass else : if port_number < 1024 : if port_number in list ( mapped_ports . keys ( ) ) : if mapped_ports [ port_number ] >= 1024 : continue exposes_priv = True if exposes_priv and HostInfo . uid != 0 : Msg ( ) . err ( "Error: this container exposes privileged TCP/IP ports" ) return False if exposes_port : Msg ( ) . out ( "Warning: this container exposes TCP/IP ports" , l = Msg . WAR ) return True