public DockerImage withRegistry(String registry) {
        if (registry.isBlank()) throw new IllegalArgumentException("Registry cannot be empty");
        if (registry.charAt(registry.length() - 1) == '/') throw new IllegalArgumentException("Registry cannot end with '/': " + registry);
        return new DockerImage(registry, repository, tag);
    }
Returns a copy of this with registry set to given value
config-provisioning/src/main/java/com/yahoo/config/provision/DockerImage.java