Ability to build container against docker swarm
Add a decode=True option during call to dockerAPI in order to build container against recent docker swarm. Closes-Bug: #1779460 Change-Id: I48f041e7ed9dd5a5f410b4eaa081f6f013119d17
This commit is contained in:
parent
430f335a8b
commit
f53fcc7e5b
@ -569,15 +569,15 @@ class BuildTask(DockerTask):
|
|||||||
|
|
||||||
buildargs = self.update_buildargs()
|
buildargs = self.update_buildargs()
|
||||||
try:
|
try:
|
||||||
for response in self.dc.build(path=image.path,
|
for stream in self.dc.build(path=image.path,
|
||||||
tag=image.canonical_name,
|
tag=image.canonical_name,
|
||||||
nocache=not self.conf.cache,
|
nocache=not self.conf.cache,
|
||||||
rm=True,
|
rm=True,
|
||||||
network_mode=self.conf.network_mode,
|
decode=True,
|
||||||
pull=pull,
|
network_mode=self.conf.network_mode,
|
||||||
forcerm=self.forcerm,
|
pull=pull,
|
||||||
buildargs=buildargs):
|
forcerm=self.forcerm,
|
||||||
stream = json.loads(response.decode('utf-8'))
|
buildargs=buildargs):
|
||||||
if 'stream' in stream:
|
if 'stream' in stream:
|
||||||
for line in stream['stream'].split('\n'):
|
for line in stream['stream'].split('\n'):
|
||||||
if line:
|
if line:
|
||||||
|
@ -87,7 +87,7 @@ class TasksTest(base.TestCase):
|
|||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
mock_client().build.assert_called_once_with(
|
mock_client().build.assert_called_once_with(
|
||||||
path=self.image.path, tag=self.image.canonical_name,
|
path=self.image.path, tag=self.image.canonical_name, decode=True,
|
||||||
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
||||||
buildargs=None)
|
buildargs=None)
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ class TasksTest(base.TestCase):
|
|||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
mock_client().build.assert_called_once_with(
|
mock_client().build.assert_called_once_with(
|
||||||
path=self.image.path, tag=self.image.canonical_name,
|
path=self.image.path, tag=self.image.canonical_name, decode=True,
|
||||||
network_mode='host', nocache=False, rm=True, pull=True,
|
network_mode='host', nocache=False, rm=True, pull=True,
|
||||||
forcerm=True, buildargs=None)
|
forcerm=True, buildargs=None)
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ class TasksTest(base.TestCase):
|
|||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
mock_client().build.assert_called_once_with(
|
mock_client().build.assert_called_once_with(
|
||||||
path=self.image.path, tag=self.image.canonical_name,
|
path=self.image.path, tag=self.image.canonical_name, decode=True,
|
||||||
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
||||||
buildargs=build_args)
|
buildargs=build_args)
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ class TasksTest(base.TestCase):
|
|||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
mock_client().build.assert_called_once_with(
|
mock_client().build.assert_called_once_with(
|
||||||
path=self.image.path, tag=self.image.canonical_name,
|
path=self.image.path, tag=self.image.canonical_name, decode=True,
|
||||||
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
||||||
buildargs=build_args)
|
buildargs=build_args)
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ class TasksTest(base.TestCase):
|
|||||||
builder.run()
|
builder.run()
|
||||||
|
|
||||||
mock_client().build.assert_called_once_with(
|
mock_client().build.assert_called_once_with(
|
||||||
path=self.image.path, tag=self.image.canonical_name,
|
path=self.image.path, tag=self.image.canonical_name, decode=True,
|
||||||
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
network_mode=None, nocache=False, rm=True, pull=True, forcerm=True,
|
||||||
buildargs=build_args)
|
buildargs=build_args)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user