'Generate a Distributed Application Bundle (DAB) from the Compose file.
Images must have digests stored, which requires interaction with a
Docker registry. If digests aren\'t stored for all images, you can fetch
them with `docker-compose pull` or `docker-compose push`. To push images
automatically when bundling, pass `--push-images`. Only services with
a `build` option specified will have their images pushed.
Usage: bundle [options]
Options:
--push-images              Automatically push images for any services
which have a `build` option specified.
-o, --output PATH          Path to write the bundle file to.
Defaults to "<project name>.dab".'

def bundle(self, config_options, options):

    self.project = project_from_options(u'.', config_options)
    compose_config = get_config_from_options(self.project_dir, config_options)
    output = options[u'--output']
    if (not output):
        output = u'{}.dab'.format(self.project.name)
    image_digests = image_digests_for_project(self.project, options[u'--push-images'])
    with open(output, u'w') as f:
        f.write(serialize_bundle(compose_config, image_digests))
    log.info(u'Wrote    bundle    to    {}'.format(output))
