@classmethod<EOL><INDENT>def build(cls, path, tag=None, dockerfile=None):<DEDENT>
if not path:<EOL><INDENT>raise ConuException('<STR_LIT>')<EOL><DEDENT>client = get_client()<EOL>response = [line for line in client.build(path,<EOL>rm=True, tag=tag,<EOL>dockerfile=dockerfile,<EOL>quiet=True)]<EOL>if not response:<EOL><INDENT>raise ConuException('<STR_LIT>')<EOL><DEDENT>if len(response) > <NUM_LIT:1>:<EOL><INDENT>raise ConuException('<STR_LIT>' + str(response))<EOL><DEDENT>response_utf = response[<NUM_LIT:0>].decode('<STR_LIT:utf-8>')<EOL>if response_utf[:<NUM_LIT:11>] != '<STR_LIT>' or response_utf[-<NUM_LIT:6>:] != '<STR_LIT>':<EOL><INDENT>raise ConuException('<STR_LIT>' + response_utf)<EOL><DEDENT>image_id = response_utf[<NUM_LIT:11>:-<NUM_LIT:6>]<EOL>return cls(None, identifier=image_id)<EOL>
Build the image from the provided dockerfile in path

:param path : str, path to the directory containing the Dockerfile
:param tag: str, A tag to add to the final image
:param dockerfile: str, path within the build context to the Dockerfile
:return: instance of DockerImage