diff --git a/docker/types/services.py b/docker/types/services.py index 9291c9bd42..a95e3e5478 100644 --- a/docker/types/services.py +++ b/docker/types/services.py @@ -107,11 +107,14 @@ def __init__(self, image, command=None, args=None, hostname=None, env=None, if labels is not None: self['Labels'] = labels if mounts is not None: + parsed_mounts = [] for mount in mounts: if isinstance(mount, six.string_types): - mounts.append(Mount.parse_mount_string(mount)) - mounts.remove(mount) - self['Mounts'] = mounts + parsed_mounts.append(Mount.parse_mount_string(mount)) + else: + # If mount already parsed + parsed_mounts.append(mount) + self['Mounts'] = parsed_mounts if stop_grace_period is not None: self['StopGracePeriod'] = stop_grace_period