diff --git a/container/utils/__init__.py b/container/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/container/utils/__init__.py
+++ b/container/utils/__init__.py
@@ -102,7 +102,7 @@ def metadata_to_image_config(metadata):
 
     def ports_to_exposed_ports(list_of_ports):
         to_return = {}
-        for port_spec in list_of_ports:
+        for port_spec in map(text_type, list_of_ports):
             exposed_ports = port_spec.rsplit(':', 1)[-1]
             protocol = 'tcp'
             if '/' in exposed_ports:
Apply text_type to ports (#<I>)