@@ -117,8 +117,8 @@ def _container_config(self, image, command, hostname=None, user=None,
117
117
else :
118
118
units = {'b' : 1 ,
119
119
'k' : 1024 ,
120
- 'm' : 1024 * 1024 ,
121
- 'g' : 1024 * 1024 * 1024 }
120
+ 'm' : 1024 * 1024 ,
121
+ 'g' : 1024 * 1024 * 1024 }
122
122
suffix = mem_limit [- 1 ].lower ()
123
123
124
124
# Check if the variable is a string representation of an int
@@ -158,6 +158,9 @@ def _container_config(self, image, command, hostname=None, user=None,
158
158
exposed_ports ['{0}/{1}' .format (port , proto )] = {}
159
159
ports = exposed_ports
160
160
161
+ if isinstance (volumes , six .string_types ):
162
+ volumes = [volumes , ]
163
+
161
164
if isinstance (volumes , list ):
162
165
volumes_dict = {}
163
166
for vol in volumes :
@@ -500,6 +503,9 @@ def create_container(self, image, command=None, hostname=None, user=None,
500
503
cpu_shares = None , working_dir = None , domainname = None ,
501
504
memswap_limit = 0 ):
502
505
506
+ if isinstance (volumes , six .string_types ):
507
+ volumes = [volumes , ]
508
+
503
509
config = self ._container_config (
504
510
image , command , hostname , user , detach , stdin_open , tty , mem_limit ,
505
511
ports , environment , dns , volumes , volumes_from , network_disabled ,
0 commit comments