Esempio n. 1
0
        public void CheckIfServiceIsRunning()
        {
            const string dockerd          = "dockerd";
            const string dockerContainerd = "docker-containerd";

            if (!_ps.IsProcessRunning(dockerd))
            {
                throw new ContainerServiceNotRunningException(Resources.Error_DockerServiceNotRunning.FormatInvariant(dockerd));
            }

            // NOTE: the service is docker-containerd however ProcessName for the service is docker-containe.
            if (!_ps.IsProcessRunning("docker-containe"))
            {
                throw new ContainerServiceNotRunningException(Resources.Error_DockerServiceNotRunning.FormatInvariant(dockerContainerd));
            }
        }
Esempio n. 2
0
        public void CheckIfServiceIsRunning()
        {
            using (var sc = new ServiceController(DockerServiceName)) {
                if (sc.Status != ServiceControllerStatus.Running)
                {
                    throw new ContainerServiceNotRunningException(DockerServiceName, Resources.Error_DockerServiceNotRunning.FormatInvariant(sc.Status.ToString()));
                }

                if (!_ps.IsProcessRunning(DockerForWindowsName))
                {
                    throw new ContainerServiceNotRunningException(DockerForWindowsName, Resources.Error_DockerForWindowsNotRunning);
                }
            }
        }
        public void CheckIfServiceIsRunning()
        {
            const string serviceName = "com.docker.service";

            using (var sc = new ServiceController(serviceName)) {
                if (sc.Status != ServiceControllerStatus.Running)
                {
                    throw new ContainerServiceNotRunningException(Resources.Error_DockerServiceNotRunning.FormatInvariant(sc.Status.ToString()));
                }

                if (!_ps.IsProcessRunning("Docker for windows"))
                {
                    throw new ContainerServiceNotRunningException(Resources.Error_DockerForWindowsNotRunning);
                }
            }
        }