<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_base_image(path: str):
 """Pulls the latest version of the base image"""

    with open(path, 'r') as file_handle:
        contents = file_handle.read()

    regex = re.compile('from\s+(?P<source>[^\s]+)', re.IGNORECASE)
    matches = regex.findall(contents)

    if not matches:
        return None

    match = matches[0]
    os.system('docker pull {}'.format(match))
    return match