浏览代码

Fix external port config

When exposing a port externally, it seems Docker only actually exposes it
if you specify the *internal* port as `xxxx/tcp`. So add that on if it's
not there.
Aanand Prasad 11 年之前
父节点
当前提交
c6e19e34f7
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fig/service.py

+ 2 - 0
fig/service.py

@@ -224,6 +224,8 @@ class Service(object):
                 port = str(port)
                 port = str(port)
                 if ':' in port:
                 if ':' in port:
                     port = port.split(':')[-1]
                     port = port.split(':')[-1]
+                if '/' not in port:
+                    port = "%s/tcp" % port
                 ports.append(port)
                 ports.append(port)
             container_options['ports'] = ports
             container_options['ports'] = ports