private boolean checkForSquash(ImageConfiguration imageConfig) {
        String squash = System.getProperty("docker.squash");
        if (squash != null) {
            return squash.length() == 0 || Boolean.valueOf(squash);
        } else {
            BuildImageConfiguration buildConfig = imageConfig.getBuildConfiguration();
            return buildConfig.squash();
        }
    }
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