Add support for build arguments

Allows 'build' configuration option to be specified as an
object and adds support for build args.

Signed-off-by: Garrett Heel <garrettheel@gmail.com>
This commit is contained in:
Garrett Heel 2015-12-11 15:19:51 -08:00 committed by Joffrey F
commit 9cfa71ceee
9 changed files with 297 additions and 49 deletions

View file

@ -638,7 +638,8 @@ class Service(object):
def build(self, no_cache=False, pull=False, force_rm=False):
log.info('Building %s' % self.name)
path = self.options['build']
build_opts = self.options.get('build', {})
path = build_opts.get('context')
# python2 os.path() doesn't support unicode, so we need to encode it to
# a byte string
if not six.PY3:
@ -652,7 +653,8 @@ class Service(object):
forcerm=force_rm,
pull=pull,
nocache=no_cache,
dockerfile=self.options.get('dockerfile', None),
dockerfile=build_opts.get('dockerfile', None),
buildargs=build_opts.get('args', None),
)
try: