private void copyFromExistingContainers(DockerAccess dockerAccess, ArchiveService archiveService,
            QueryService queryService) throws IOException, MojoExecutionException {
        List<ImageConfiguration> imageConfigurations = getResolvedImages();
        for (ImageConfiguration imageConfiguration : imageConfigurations) {
            CopyConfiguration copyConfiguration = imageConfiguration.getCopyConfiguration();
            String imageName = imageConfiguration.getName();
            if (isEmpty(copyConfiguration)) {
                log.debug("Copy configuration is not defined for %s image, skipping coping", imageName);
                continue;
            }
            Collection<Container> containers = getContainersForImage(queryService, imageConfiguration);
            if (containers.isEmpty()) {
                log.warn("Found no containers of %s image", imageName);
                continue;
            }
            if (containers.size() > 1) {
                log.warn("Found more than one container of %s image", imageName);
            }
            for (Container container : containers) {
                String containerId = container.getId();
                log.debug("Found %s container of %s image", containerId, imageName);
                copy(dockerAccess, archiveService, containerId, imageName, copyConfiguration);
            }
        }
    }
Whether to copy from all containers matching configured images or only from the newest ones.
src/main/java/io/fabric8/maven/docker/CopyMojo.java