private String matchArchiveImagesToPattern(String imageNamePattern, ImageArchiveManifest manifest) {
        String imageNameRegex = NamePatternUtil.convertNamePattern(imageNamePattern);
        log.debug("Image name regex is %s", imageNameRegex);

        Map<String, ImageArchiveManifestEntry> entries = ImageArchiveUtil.findEntriesByRepoTagPattern(imageNameRegex, manifest);

        // Show the matches from the manifest to users trying to debug their configuration
        if (log.isDebugEnabled()) {
            for (Map.Entry<String, ImageArchiveManifestEntry> entry : entries.entrySet()) {
                log.debug("Repo tag pattern matched %s referring to image %s", entry.getKey(), entry.getValue().getId());
            }
        }

        if (!entries.isEmpty()) {
            Map.Entry<String, ImageArchiveManifestEntry> matchedEntry = entries.entrySet().iterator().next();

            if (ImageArchiveUtil.mapEntriesById(entries.values()).size() > 1) {
                log.warn("Multiple image ids matched pattern %s: using tag %s associated with id %s",
                        imageNamePattern, matchedEntry.getKey(), matchedEntry.getValue().getId());
            } else {
                log.info("Using image tag %s from archive", matchedEntry.getKey());
            }

            return matchedEntry.getKey();
        }

        return null;
    }
Build an image

@param imageConfig the image configuration
@param params      mojo params for the project
@param noCache     if not null, dictate the caching behaviour. Otherwise its taken from the build configuration
@param buildArgs   docker build args
@throws DockerAccessException
@throws MojoExecutionException
src/main/java/io/fabric8/maven/docker/service/BuildService.java