public void copyDockerArchive(ImageConfiguration imageConfiguration, File dockerArchive, String archivePath) throws IOException {
        if (archivePath != null && !archivePath.isEmpty()) {
            Files.copy(dockerArchive.toPath(), new File(archivePath, dockerArchive.getName()).toPath());
            log.info("%s: Copied created tarball to %s", imageConfiguration.getDescription(), archivePath);
        }
    }
Create docker archive for building image

@param imageConfiguration image configuration
@param buildContext       docker build context
@param archivePath        build archive only flag, it can have values TRUE or FALSE and also
                          it can hold path to archive where it might get copied over
@return tarball for docker image
@throws MojoExecutionException in case any exception comes during building tarball
src/main/java/io/fabric8/maven/docker/service/BuildService.java