Esempio n. 1
0
    def create_service(self, name, **kwargs):
        if 'image' not in kwargs and 'build' not in kwargs:
            kwargs['image'] = 'busybox:latest'

        if 'command' not in kwargs:
            kwargs['command'] = ["top"]

        service_config = ServiceConfig('.', None, name, kwargs)
        options = process_service(service_config)
        options['environment'] = resolve_environment('.', kwargs)
        labels = options.setdefault('labels', {})
        labels['com.docker.compose.test-name'] = self.id()

        return Service(name, client=self.client, project='composetest', **options)