public void removeCustomNetworks(Collection<Network> networks) throws DockerAccessException {
		List<DockerAccessException> thrownExceptions = new ArrayList<>();
        for (Network network : networks) {
			try {
				docker.removeNetwork(network.getId());
			} catch (DockerAccessException exc) {
				thrownExceptions.add(exc);
			}
		}
		if (!thrownExceptions.isEmpty()) {
			DockerAccessException exception = new DockerAccessException("At least one exception was thrown while trying to remove custom networks.");
			for (DockerAccessException dae : thrownExceptions) {
				exception.addSuppressed(dae);
			}
			throw exception;
        }
    }
Add a shutdown hook in order to stop all registered containers
src/main/java/io/fabric8/maven/docker/service/RunService.java