def build(self, runtime, layers):
base_image = "<STR_LIT>".format(self._DOCKER_LAMBDA_REPO_NAME, runtime)<EOL>if not layers:<EOL><INDENT>LOG.debug("<STR_LIT>")<EOL>return base_image<EOL><DEDENT>downloaded_layers = self.layer_downloader.download_all(layers, self.force_image_build)<EOL>docker_image_version = self._generate_docker_image_version(downloaded_layers, runtime)<EOL>image_tag = "<STR_LIT>".format(self._SAM_CLI_REPO_NAME, docker_image_version)<EOL>image_not_found = False<EOL>try:<EOL><INDENT>self.docker_client.images.get(image_tag)<EOL><DEDENT>except docker.errors.ImageNotFound:<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>image_not_found = True<EOL><DEDENT>if self.force_image_build orimage_not_found orany(layer.is_defined_within_template for layer in downloaded_layers):<EOL><INDENT>LOG.info("<STR_LIT>")<EOL>self._build_image(base_image, image_tag, downloaded_layers)<EOL><DEDENT>return image_tag<EOL>
Build the image if one is not already on the system that matches the runtime and layers

Parameters
----------
runtime str
    Name of the Lambda runtime
layers list(samcli.commands.local.lib.provider.Layer)
    List of layers

Returns
-------
str
    The image to be used (REPOSITORY:TAG)