Build all docker images for the project.
352722
def build_images():
    # type: () -> None
    
    registry = conf.get('docker.registry')
    docker_images = conf.get('docker.images', [])

    for image in docker_images:
        build_image(registry, image)
703903
def build_from_path(path)
      if !File.directory?(path) && File.basename(path) == 'Dockerfile'
        path = File.dirname(path)
      end
      File.directory?(path) ? build_from_dir(path) : build_from_file(path)
    end
1078563
def build(self):
        """"""
        for cmd in self.build_cmds:
            log.info('building command: {}'.format(cmd))
            full_cmd = 'cd {}; {}'.format(self.analyses_path, cmd)
            log.debug('full command: {}'.format(full_cmd))
            subprocess.call(full_cmd, shell=True)
            log.info('build done')
397992
def pull_all_external(collector, **kwargs):
    """"""
    deps = set()

    images = collector.configuration["images"]
    for layer in Builder().layered(images):
        for image_name, image in layer:
            for dep in image.commands.external_dependencies:
                deps.add(dep)

    for dep in sorted(deps):
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)
448831
public function build()
    {
        $themes = (array)$this->config->general('themes');
        foreach ($themes as $theme) {
            $this->_io->verbose('Building with theme = ' . $theme);
            $this->config->theme($theme);
            foreach ($this->factory->assetCollection() as $target) {
                if ($target->isThemed()) {
                    $this->_buildTarget($target);
                }
            }
        }
        $this->_io->verbose('Building un-themed targets.');
        foreach ($this->factory->assetCollection() as $target) {
            $this->_buildTarget($target);
        }
    }
665162
def all_build_jobs(self):
        
        from db.models.build_jobs import BuildJob

        return BuildJob.all.filter(project=self)
856772
def build(image, build_path, tag=None, build_args=None, fromline=None, args=[]):
    

    if tag:
        image = ":".join([image, tag])

    bdir = tempfile.mkdtemp()
    os.system('cp -r {0:s}/* {1:s}'.format(build_path, bdir))
    if build_args:
        stdw = tempfile.NamedTemporaryFile(dir=bdir, mode='w')
        with open("{}/Dockerfile".format(bdir)) as std:
            dfile = std.readlines()

        for line in dfile:
            if fromline and line.lower().startswith('from'):
                stdw.write('FROM {:s}\n'.format(fromline))
            elif line.lower().startswith("cmd"):
                for arg in build_args:
                    stdw.write(arg+"\n")
                stdw.write(line)
            else:
                stdw.write(line)
        stdw.flush()
        utils.xrun("docker build", args+["--force-rm","-f", stdw.name, 
                   "-t", image, 
                    bdir])

        stdw.close()
    else:
        utils.xrun("docker build", args+["--force-rm", "-t", image, 
                    bdir])

    os.system('rm -rf {:s}'.format(bdir))
773685
def build(templates=None, schemes=None, base_output_dir=None):
    """"""
    template_dirs = templates or get_template_dirs()
    scheme_files = get_scheme_files(schemes)
    base_output_dir = base_output_dir or rel_to_cwd('output')

    # raise LookupError if there is not at least one template or scheme
    # to work with
    if not template_dirs or not scheme_files:
        raise LookupError

    # raise PermissionError if user has no write acces for $base_output_dir
    try:
        os.makedirs(base_output_dir)
    except FileExistsError:
        pass

    if not os.access(base_output_dir, os.W_OK):
        raise PermissionError

    templates = [TemplateGroup(path) for path in template_dirs]

    build_from_job_list(scheme_files, templates, base_output_dir)
    print('Finished building process.')
1115741
def BuildTemplate(self,
                    context=None,
                    output=None,
                    fleetspeak_service_config=None):
    """"""
    context = context or []
    context.append("Arch:%s" % self.GetArch())
    # Platform context has common platform settings, Target has template build
    # specific stuff.
    self.platform = platform.system()
    context.append("Platform:%s" % self.platform)
    context.append("Target:%s" % self.platform)
    if "Target:Linux" in context:
      context.append(self.GetPackageFormat())

    template_path = None
    if output:
      template_path = os.path.join(
          output,
          grr_config.CONFIG.Get(
              "PyInstaller.template_filename", context=context))

    builder_obj = self.GetBuilder(context, fleetspeak_service_config)
    builder_obj.MakeExecutableTemplate(output_file=template_path)
368092
def build(self, *args, **kwargs):
        """"""
        # Create the directories of the work.
        self.indir.makedirs()
        self.outdir.makedirs()
        self.tmpdir.makedirs()

        # Build dirs and files of each task.
        for task in self:
            task.build(*args, **kwargs)

        # Connect signals within the work.
        self.connect_signals()
914271
public function build()
    {
        $files = $this->filesystem->listFiles($this->directory, $this->recursive);

        $this->cache->clear();

        foreach ($files as $file) {
            $entity = $this->parseFile($file);
            if ($entity != null) $this->cache->put($entity->getIdentifier(), $entity);
        }
        
        $this->cache->persist();
    }
36479
def build_source_files(self):
        """"""

        from .files import BuildSourceFileAccessor
        return BuildSourceFileAccessor(self, self.dataset, self.source_fs)
597620
def build(config, services):
    
    filtered_services = {name: service for name, service in services.iteritems() if 'build' in service}

    _call_output('docker-compose build {}'.format(' '.join(filtered_services.iterkeys())))

    version = _get_version()

    for service_name, service_dict in filtered_services.iteritems():
        # Tag with proper version, they're already tagged latest from build
        image = service_dict['image']
        _call('docker tag {image}:latest {image}:{version}'.format(
                image=image,
                version=version
            )
        )
44230
def build(self):
        """"""
        if os.path.exists(self.build_path) and not os.path.isdir(self.build_path):
            self._logger.error('Output path must be a folder if it already exists')
            return
        Compiler._mkdir(self.build_path)
        self._execute_backend_on_spec()
1009134
def build(self):
        """"""
        self.load_builtins()
        self.load_functions(self.tree)
        self.visit(self.tree)
1215193
def build_image_list(config, image, imagefile, all_local, include_allanchore, dockerfile=None, exclude_file=None):
    """"""

    if not image and not (imagefile or all_local):
        raise click.BadOptionUsage('No input found for image source. One of <image>, <imagefile>, or <all> must be specified')

    if image and imagefile:
        raise click.BadOptionUsage('Only one of <image> and <imagefile> can be specified')

    filter_images = []
    if exclude_file:
        with open(exclude_file) as f:
            for line in f.readlines():
                filter_images.append(line.strip())

    imagelist = {}
    if image:
        imagelist[image] = {'dockerfile':dockerfile}

    if imagefile:
        filelist = anchore_utils.read_kvfile_tolist(imagefile)
        for i in range(len(filelist)):
            l = filelist[i]
            imageId = l[0]
            try:
                dfile = l[1]
            except:
                dfile = None
            imagelist[imageId] = {'dockerfile':dfile}

    if all_local:
        docker_cli = contexts['docker_cli']
        if docker_cli:
            for f in docker_cli.images(all=True, quiet=True, filters={'dangling': False}):
                if f not in imagelist and f not in filter_images:
                    imagelist[f] = {'dockerfile':None}
        else:
            raise Exception("Could not load any images from local docker host - is docker running?")

    if include_allanchore:
        ret = contexts['anchore_db'].load_all_images().keys()
        if ret and len(ret) > 0:
            for l in list(set(imagelist.keys()) | set(ret)):
                imagelist[l] = {'dockerfile':None}

    # Remove excluded items
    for excluded in filter_images:
        docker_cli = contexts['docker_cli']
        if not docker_cli:
            raise Exception("Could not query docker - is docker running?")
        for img in docker_cli.images(name=excluded, quiet=True):
            imagelist.pop(img, None)

    return imagelist
704951
def create(name, image, bare):
    
    if bool(bare) == bool(image):
        raise click.UsageError("Specify either --bare or image using --image.")

    path = get_project_path(name)

    print("Creating %s..." % path)
    try:
        os.mkdir(path)
    except FileExistsError:
        die("%s already exists." % path)

    if not bare:
        print("Creating container with image %s..." % image)
        client = docker.Client()
        try:
            client.create_container(
                image=image,
                name=get_container_name(name),
                hostname=name,
                working_dir='/code/',
                command='tail -f /dev/null',
                tty=True,
                volumes=['/code/'],
                host_config=client.create_host_config(binds={
                    path: {'bind': '/code/', 'mode': 'rw'}
                })
            )
        except docker.errors.APIError as error:
            die(error.explanation.decode())

    enter_project(name)