private void autoPullCacheFromImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildContext buildContext) throws DockerAccessException, MojoExecutionException {
        if (imageConfig.getBuildConfiguration().getCacheFrom() == null) {
            return;
        }

        BuildImageConfiguration buildConfig = imageConfig.getBuildConfiguration();
        CleanupMode cleanupMode = buildConfig.cleanupMode();

        for (String cacheFromImage : buildConfig.getCacheFrom()) {
            String oldImageId = null;
            if (cleanupMode.isRemove()) {
                oldImageId = queryService.getImageId(cacheFromImage);
            }

            try {
                registryService.pullImageWithPolicy(cacheFromImage, imagePullManager, buildContext.getRegistryConfig(), buildConfig);
            } catch (DockerAccessException e) {
                log.warn("Could not pull cacheFrom image: '%s'. Reason: %s", cacheFromImage, e.getMessage());
            }

            String newImageId = queryService.getImageId(cacheFromImage);

            removeDanglingImage(cacheFromImage, oldImageId, newImageId, cleanupMode, false);
        }
    }
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