public void assertValid() {
        //noinspection UnstableApiUsage
        HostAndPort.fromString(registry); // return value ignored - this throws if registry is not a valid host:port string
        if (!REPO_NAME.matcher(repository).matches()) {
            throw new IllegalArgumentException(repository + " is not a valid Docker image name (in " + rawName + ")");
        }
        if (!versioning.isValid()) {
            throw new IllegalArgumentException(
                versioning + " is not a valid image versioning identifier (in " + rawName + ")"
            );
        }
    }
Is the image name valid?

@throws IllegalArgumentException if not valid
core/src/main/java/org/testcontainers/utility/DockerImageName.java