fixies in docker driver:
class DockerResponse,
functions deploy_container and start_container
@@ -54,7 +54,8 @@ class DockerResponse(JsonResponse):
# an error, but response status could still be 200
content_type = self.headers.get('content-type', 'application/json')
if content_type == 'application/json' or content_type == '':
- if self.headers.get('transfer-encoding') == 'chunked':
+ if self.headers.get('transfer-encoding') == 'chunked' and \
+ 'fromImage' in self.request.url:
body = [json.loads(chunk) for chunk in
self.body.strip().replace('\r', '').split('\n')]
else:
@@ -386,6 +387,12 @@ class DockerContainerDriver(ContainerDriver):
data = json.dumps(payload)
if start:
+ if float(self._get_api_version()) > 1.22:
+ result = self.connection.request(
+ '/v%s/containers/%s/start' %
+ (self.version, id_),
+ method='POST')
+ else:
result = self.connection.request(
'/v%s/containers/%s/start' %
(self.version, id_), data=data,
@@ -417,6 +424,15 @@ class DockerContainerDriver(ContainerDriver):
:return: The container refreshed with current data
:rtype: :class:`libcloud.container.base.Container`
"""
+ # TODO docstring
+ # starting container with non-empty request body
+ # was deprecated since v1.10 and removed in v1.12
+ if float(self._get_api_version()) > 1.22:
+ result = self.connection.request(
+ '/v%s/containers/%s/start' %
+ (self.version, container.id),
+ method='POST')
+ else:
payload = {
'Binds': [],
'PublishAllPorts': True,
