private void collectCustomNetworks(Set<Network> networksToRemove, ContainerTracker.ContainerShutdownDescriptor descriptor, boolean removeCustomNetworks) throws DockerAccessException {
        final NetworkConfig config = descriptor.getImageConfiguration().getRunConfiguration().getNetworkingConfig();
        if (removeCustomNetworks && config.isCustomNetwork()) {
           networksToRemove.add(queryService.getNetworkByName(config.getCustomNetwork()));
        }
    }
Stop all registered container
@param keepContainer whether to keep container or to remove them after stopping
@param removeVolumes whether to remove volumes after stopping
@throws DockerAccessException if during stopping of a container sth fails
src/main/java/io/fabric8/maven/docker/service/RunService.java