isDaemonRunning static method

FutureOr<bool> isDaemonRunning(
  1. DockerHost dockerHost, {
  2. bool allowCache = true,
})

Returns true if the Docker Daemon is running. The result is cached for the dockerHost. See resetIsDaemonRunningCache.

  • if allowCache is true, it will cache the result.

Implementation

static FutureOr<bool> isDaemonRunning(DockerHost dockerHost,
    {bool allowCache = true}) {
  if (allowCache) {
    var cached = _daemonRunning[dockerHost];
    if (cached != null) return cached;
  }

  return _isDaemonRunningImpl(dockerHost).then((running) {
    _daemonRunning[dockerHost] = running;
    return running;
  });
}