private void parseComponentsBeforeTag(String rest) {
        String[] parts = rest.split("\\s*/\\s*");
        if (parts.length == 1) {
            registry = null;
            user = null;
            repository = parts[0];
        } else if (parts.length >= 2) {
            if (isRegistry(parts[0])) {
                registry = parts[0];
                if (parts.length > 2) {
                    user = parts[1];
                    repository = joinTail(parts);
                } else {
                    user = null;
                    repository = parts[1];
                }
            } else {
                registry = null;
                user = parts[0];
                repository = rest;
            }
        }
    }
Check whether the given name validates agains the Docker rules for names

@param image image name to validate
d@throws IllegalArgumentException if the name doesnt validate
src/main/java/io/fabric8/maven/docker/util/ImageName.java