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()
|
||||
try:
|
||||
for response in self.dc.build(path=image.path,
|
||||
tag=image.canonical_name,
|
||||
nocache=not self.conf.cache,
|
||||
rm=True,
|
||||
network_mode=self.conf.network_mode,
|
||||
pull=pull,
|
||||
forcerm=self.forcerm,
|
||||
buildargs=buildargs):
|
||||
stream = json.loads(response.decode('utf-8'))
|
||||
for stream in self.dc.build(path=image.path,
|
||||
tag=image.canonical_name,
|
||||
nocache=not self.conf.cache,
|
||||
rm=True,
|
||||
decode=True,
|
||||
network_mode=self.conf.network_mode,
|
||||
pull=pull,
|
||||
forcerm=self.forcerm,
|
||||
buildargs=buildargs):
|
||||
if 'stream' in stream:
|
||||
for line in stream['stream'].split('\n'):
|
||||
if line:
|
||||
|
@ -87,7 +87,7 @@ class TasksTest(base.TestCase):
|
||||
builder.run()
|
||||
|
||||
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,
|
||||
buildargs=None)
|
||||
|
||||
@ -104,7 +104,7 @@ class TasksTest(base.TestCase):
|
||||
builder.run()
|
||||
|
||||
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,
|
||||
forcerm=True, buildargs=None)
|
||||
|
||||
@ -124,7 +124,7 @@ class TasksTest(base.TestCase):
|
||||
builder.run()
|
||||
|
||||
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,
|
||||
buildargs=build_args)
|
||||
|
||||
@ -143,7 +143,7 @@ class TasksTest(base.TestCase):
|
||||
builder.run()
|
||||
|
||||
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,
|
||||
buildargs=build_args)
|
||||
|
||||
@ -164,7 +164,7 @@ class TasksTest(base.TestCase):
|
||||
builder.run()
|
||||
|
||||
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,
|
||||
buildargs=build_args)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user