def METHOD_NAME(
    self,
    port,
    request_path,
    health_path,
    repository,
    tag,
    sha,
    env_vars,
):
    hypothesis.assume(tag or sha)
    request_path = arg_handler.ensure_starts_with_slash(request_path)
    health_path = arg_handler.ensure_starts_with_slash(health_path)
    msg = RegistryService_pb2.ModelVersion()
    msg.docker_metadata.request_port = port
    msg.docker_metadata.request_path = request_path
    msg.docker_metadata.health_path = health_path
    msg.environment.docker.repository = repository
    if tag is not None:
        msg.environment.docker.tag = tag
    if sha is not None:
        msg.environment.docker.sha = sha
    if env_vars is not None:
        msg.environment.environment_variables.extend(
            [
                Environment_pb2.EnvironmentVariablesBlob(name=name, value=value)
                for name, value in env_vars.items()
            ]
        )
    docker_image = DockerImage._from_model_ver_proto(msg)
    assert docker_image.port == port
    assert docker_image.request_path == request_path
    assert docker_image.health_path == health_path
    assert docker_image.repository == repository
    assert docker_image.tag == tag
    assert docker_image.sha == sha
    assert docker_image.env_vars == (env_vars or None)