def build_image(self, image_name: str, image_tag: str,<EOL>repo_path: Path,<EOL>requirements_option: RequirementsOptions,<EOL>dependencies: Optional[List[str]]):
if self.inherit_image is not None:<EOL><INDENT>return self.build_image_from_inherited_image(image_name, image_tag, repo_path, requirements_option)<EOL><DEDENT>if requirements_option == RequirementsOptions.no_requirements:<EOL><INDENT>python_version = self.get_python_version()<EOL>if dependencies is None:<EOL><INDENT>base_name, base_tag = self.get_python_base(python_version, pull=not self.disable_pull)<EOL>image = self.get_image(base_name, base_tag)<EOL>image.tag(image_name, image_tag)<EOL>return image<EOL><DEDENT>def install_dependencies_dockerfile():<EOL><INDENT>base_name, base_tag = self.get_python_base(python_version, pull=not self.disable_pull)<EOL>return self.INSTALL_DEPENDENCIES.format(<EOL>name=base_name,<EOL>tag=base_tag,<EOL>dependencies="<STR_LIT:U+0020>".join(dependencies)<EOL>)<EOL><DEDENT>self.get_or_build_image(image_name, image_tag, install_dependencies_dockerfile)<EOL>return self.get_image(image_name, image_tag)<EOL><DEDENT>else:  <EOL><INDENT>def install_requirements_dockerfile():<EOL><INDENT>"""<STR_LIT>"""<EOL>dependencies_name, dependencies_tag = self.get_image_with_installed_dependencies(image_name,<EOL>dependencies)<EOL>return self.get_install_requirements_dockerfile(<EOL>name=dependencies_name,<EOL>tag=dependencies_tag,<EOL>repo_path=repo_path,<EOL>requirements_option=requirements_option,<EOL>)<EOL><DEDENT>self.get_or_build_image(image_name, image_tag, install_requirements_dockerfile,<EOL>build_context=repo_path.parent, pull=False)<EOL>return self.get_image(image_name, image_tag)<EOL><DEDENT>
Builds an image for specific requirements and dependencies, based on the settings.

        :param image_name: How the image should be named
        :param image_tag: And what tag it should have.
        :param repo_path: Path to the cloned repository.
        :param requirements_option: How requirements are set in the repository.
        :param dependencies: List of dependencies (in the formalized format)
        :return: The Image instance.
        :rtype: docker.models.images.Image