mirror of https://github.com/docker/compose.git
Merge pull request #1570 from aanand/fix-build-pull
Explicitly set pull=False when building
(cherry picked from commit 4f83a18912
)
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
bd0be2cdc7
commit
d6cd76c3c1
|
@ -628,6 +628,7 @@ class Service(object):
|
|||
tag=self.image_name,
|
||||
stream=True,
|
||||
rm=True,
|
||||
pull=False,
|
||||
nocache=no_cache,
|
||||
dockerfile=self.options.get('dockerfile', None),
|
||||
)
|
||||
|
|
|
@ -303,6 +303,17 @@ class ServiceTest(unittest.TestCase):
|
|||
with self.assertRaises(NeedsBuildError):
|
||||
service.create_container(do_build=False)
|
||||
|
||||
def test_build_does_not_pull(self):
|
||||
self.mock_client.build.return_value = [
|
||||
'{"stream": "Successfully built 12345"}',
|
||||
]
|
||||
|
||||
service = Service('foo', client=self.mock_client, build='.')
|
||||
service.build()
|
||||
|
||||
self.assertEqual(self.mock_client.build.call_count, 1)
|
||||
self.assertFalse(self.mock_client.build.call_args[1]['pull'])
|
||||
|
||||
|
||||
class ServiceVolumesTest(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue