Added --force-rm to compose build.

It's a flag passed to docker build that removes the intermediate
containers left behind on fail builds.

Signed-off-by: Adrian Budau <budau.adi@gmail.com>
This commit is contained in:
Adrian Budau 2015-10-27 02:00:51 -07:00 • committed by Daniel Nephin
commit c5c36d8b00
10 changed files with 48 additions and 5 deletions

View file

@ -278,10 +278,10 @@ class Project(object):
for service in self.get_services(service_names):
service.restart(**options)
def build(self, service_names=None, no_cache=False, pull=False):
def build(self, service_names=None, no_cache=False, pull=False, force_rm=False):
for service in self.get_services(service_names):
if service.can_be_built():
service.build(no_cache, pull)
service.build(no_cache, pull, force_rm)
else:
log.info('%s uses an image, skipping' % service.name)