MCPcopy
hub / github.com/indigo-dc/udocker / _get_network_map

Method _get_network_map

udocker/engine/proot.py:117–126  ·  view source on GitHub ↗

Get mapping of TCP/IP ports

(self)

Source from the content-addressed store, hash-verified

115 return proot_vol_list
116
117 def _get_network_map(self):
118 """Get mapping of TCP/IP ports"""
119 proot_netmap_list = []
120 for (cont_port, host_port) in list(self._get_portsmap().items()):
121 proot_netmap_list.extend(["-p", "%d:%d" % (cont_port, host_port)])
122 if self.opt["netcoop"] and self._has_option("--netcoop"):
123 proot_netmap_list.extend(["-n", ])
124 if proot_netmap_list and self._has_option("--port"):
125 return proot_netmap_list
126 return []
127
128 def _get_qemu_string(self):
129 """Get the qemu string for container run command if emulation needed"""

Callers 2

runMethod · 0.95

Calls 3

_get_portsmapMethod · 0.80
extendMethod · 0.80
_has_optionMethod · 0.80

Tested by 1