Explicitly set pull=False when building

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-06-18 17:43:16 -07:00
parent 8ffeaf2a54
commit bef0926c58
2 changed files with 12 additions and 0 deletions

View File

@ -612,6 +612,7 @@ class Service(object):
tag=self.image_name,
stream=True,
rm=True,
pull=False,
nocache=no_cache,
dockerfile=self.options.get('dockerfile', None),
)

View File

@ -312,6 +312,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):