I am trying to add one manager in Docker swarm. But it is showing me the below error.
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Any ideas on what I need to do to fix this? Thanks!
You can get this error if docker doesn't shut down cleanly. Run snap logs docker and look for the following:
snap logs docker
Error starting daemon: pid file found, ensure docker is not running or delete /var/snap/docker/179/run/docker.pid
Deleting that file and restarting docker worked for me.
snap stop docker
snap start docker
Make sure to replace <your-version-number> with the appropriate version number.