Is there a standard way to check if the docker daemon is running?


#1

Hi guys, good morning :):grinning:recently I am working on the k8s/kubeadm, there is a pre-flight check with crictl to check if there’s container daemon is running, in my environment I only use docker as the container engine, so I use below command to startup the cluster:
#kubeadm init --cri-socket “/var/run/docker.sock”

But seems the crictl send a POST to the “/var/run/docker.sock” socket to check if docker daemon is running, unfortunately the crictl can’t get a valid response so it’s unable to check if the container runtime is OK:
[ERROR CRI]: unable to check if the container run time at “/var/run/docker.sock” is running: exit status 1

So the question here is, is there some standard way (compatible with OCI) to check if the docker container run time is ready?


#2

There would be no OCI specification for checking if dockerd is running.
An OCI implementation does not need to be a daemon (e.g. see runc).

For a simple way to check the daemon, you can do a GET /version or a GET /info


#3

Thanks @cpuguy83 for the info, sounds like there’s no spec to define the detection of the runtime environment, I need to check the circtl code to see how it works…