public void buildImage(ImageConfiguration imageConfig, ImagePullManager imagePullManager, BuildContext buildContext, File buildArchiveFile)
            throws DockerAccessException, MojoExecutionException {

        BuildArgResolver buildArgResolver = new BuildArgResolver(log);
        Map<String, String> buildArgsFromExternalSources = buildArgResolver.resolveBuildArgs(buildContext);
        if (imagePullManager != null) {
            autoPullBaseImage(imageConfig, imagePullManager, buildContext, prepareBuildArgs(buildArgsFromExternalSources, imageConfig.getBuildConfiguration()));
            autoPullCacheFromImage(imageConfig, imagePullManager, buildContext);
        }

        buildImage(imageConfig, buildContext.getMojoParameters(), ConfigHelper.isNoCache(imageConfig), checkForSquash(imageConfig), buildArgsFromExternalSources, buildArchiveFile);
    }
Pull the base image if needed and run the build.

@param imageConfig  the image configuration
@param buildContext the build context
@throws DockerAccessException
@throws MojoExecutionException
src/main/java/io/fabric8/maven/docker/service/BuildService.java