def __init__(self, path=None,<EOL>cache_content=False,<EOL>env_replace=True,<EOL>parent_env=None,<EOL>fileobj=None):
self.fileobj = fileobj<EOL>if self.fileobj is not None:<EOL><INDENT>if path is not None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>self.fileobj.seek(<NUM_LIT:0>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>path = path or '<STR_LIT:.>'<EOL>if path.endswith(DOCKERFILE_FILENAME):<EOL><INDENT>self.dockerfile_path = path<EOL><DEDENT>else:<EOL><INDENT>self.dockerfile_path = os.path.join(path, DOCKERFILE_FILENAME)<EOL><DEDENT><DEDENT>self.cache_content = cache_content<EOL>self.cached_content = '<STR_LIT>'  <EOL>if cache_content:<EOL><INDENT>try:<EOL><INDENT>self.content<EOL><DEDENT>except (IOError, OSError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>self.env_replace = env_replace<EOL>if parent_env is None:<EOL><INDENT>self.parent_env = {}<EOL><DEDENT>else:<EOL><INDENT>assert isinstance(parent_env, dict)<EOL>logger.debug("<STR_LIT>", parent_env)<EOL>self.parent_env = parent_env<EOL><DEDENT>
Initialize source of Dockerfile
:param path: path to (directory with) Dockerfile
:param cache_content: cache Dockerfile content inside DockerfileParser
:param parent_env: python dict of inherited env vars from parent image
:param fileobj: seekable file-like object containing Dockerfile content
                as bytes (will be truncated on write)