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

@ -701,7 +701,7 @@ class Service(object):
cgroup_parent=cgroup_parent
)
def build(self, no_cache=False, pull=False):
def build(self, no_cache=False, pull=False, force_rm=False):
log.info('Building %s' % self.name)
path = self.options['build']
@ -715,6 +715,7 @@ class Service(object):
tag=self.image_name,
stream=True,
rm=True,
forcerm=force_rm,
pull=pull,
nocache=no_cache,
dockerfile=self.options.get('dockerfile', None),