def METHOD_NAME(path: Optional[Union[Path, str]] = None) -> Optional[Version]:
    """Read RENKU_VERSION from the content of path if a valid version is available."""
    from renku.domain_model.project_context import project_context
    path = Path(path) if path else project_context.dockerfile_path
    if not path.exists():
        return None
    m = re.search(r"^\s*ARG RENKU_VERSION=(\d+\.\d+\.\d+\S*)$", path.read_text(), flags=re.MULTILINE)
    if not m:
        return None
    try:
        return Version(m.group(1))
    except ValueError:
        return None