@Override
    protected void executeInternal(ServiceHub hub) throws IOException, MojoExecutionException {
        DockerAccess dockerAccess = hub.getDockerAccess();
        RunService runService = hub.getRunService();
        ArchiveService archiveService = hub.getArchiveService();
        QueryService queryService = hub.getQueryService();
        GavLabel gavLabel = getGavLabel();
        if (createContainers) {
            RegistryService registryService = hub.getRegistryService();
            log.debug("Copy mojo is invoked standalone, copying from new temporary containers");
            copyFromTemporaryContainers(dockerAccess, runService, registryService, archiveService, queryService,
                    gavLabel);
        } else if (invokedTogetherWithDockerStart()) {
            log.debug("Copy mojo is invoked together with start mojo, copying from containers created by start mojo");
            copyFromStartedContainers(dockerAccess, runService, archiveService, gavLabel);
        } else {
            log.debug("Copy mojo is invoked standalone, copying from existing containers");
            copyFromExistingContainers(dockerAccess, archiveService, queryService);
        }
    }
Whether to copy from all containers matching configured images or only from the newest ones.
src/main/java/io/fabric8/maven/docker/CopyMojo.java