private boolean shouldStopContainer(Container container, GavLabel gavLabel) {
        if (isStopAllContainers()) {
            return true;
        }
        String key = gavLabel.getKey();
        Map<String, String> labels = container.getLabels();
        return labels.containsKey(key) && gavLabel.equals(new GavLabel(labels.get(key)));
    }
If true, the containers are not stopped right away, but when the build is finished (success or failed).
src/main/java/io/fabric8/maven/docker/StopMojo.java