from typing import List
import re


def _replace_docker_images(content: str, images: List[str]) -> str:
    """Replace docker images in the given string.

    Find the provided docker images in the given string
    by docker image name and replace it with the given images (name + tag).
    """
    for image in images:
        image_name, _ = image.split(":")
        if image_name in content:
            content = re.sub(f"{image_name}:\\S*", image, content, count=1)
    return content