You may encounter the following warning message: Stopping docker.service, but it can still be activated by: docker.socket
This warning indicates that although the docker service has been stopped, it can still be activated by the docker socket.
To address this warning, you can take the following steps:
docker ps
. If there are any running containers, consider stopping them using docker stop <container_id>
.sudo systemctl restart docker.service
.sudo systemctl disable docker.socket
.The output of ps aux
suggests that you didn't initiate Docker through systemd/systemctl.
It seems you started it using:
sudo dockerd -H gridsim1103:2376
When attempting to stop it with systemctl, nothing would occur since the resulting dockerd process isn't managed by systemd. Thus, the observed behavior is expected.
The proper method to start Docker is via systemd/systemctl:
systemctl enable docker
systemctl start docker
Following this, Docker should commence on system startup.
In my situation, it wasn't systemd or a cron job, but rather snap. Thus, I had to execute:
sudo snap stop docker
sudo snap remove docker
Interestingly, the last command never seemed to complete, for reasons I couldn't ascertain. Dealing with snap can indeed be quite troublesome. Consequently, I also performed:
sudo apt purge snap