My question is: Do you have information on how to stop the docker daemon and how it is related to the docker.socket? Now I proceed top explain why I ask this question
I have installed docker engine using apt and following the instructions from Install Docker Engine on Ubuntu | Docker Docs , I am using Ubuntu 22.04.1 and docker version
Client: Docker Engine - Community
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.20.10
Git commit: 311b9ff
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.25
GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
runc:
Version: 1.1.10
GitCommit: v1.1.10-0-g18a0cb0
docker-init:
Version: 0.19.0
GitCommit: de40ad0
I tried to stop the docker daemon using sudo systemctl stop docker
following what is exposed in Linux post-installation steps for Docker Engine | Docker Docs , and I notice that the service dockerd
is no longer running. I also notice that containerd is not stop when I I stop the docker daemon, which seams odd for me.
So, I thought that after stopping docker with systemctl if I run sudo docker container ls
I would get an error regarding not being able to connect to the unix socket /avr/run/docker.sock
or not being able to connect to docker daemon, however, to my surprise the dockerd process started again and I was able to interact with docker. I assumed that the file /var/run/docker.sock would be deleted if I stop the docker daemon because something similar happens with docker desktop when it is intalled, that is, when docker desktop is stop the file $HOME/.docker/desktop/docker.sock
is deleted, such that when I try to list the containers using the docker desktop context I get:
Cannot connect to the Docker daemon at unix:///home/agentsmith/.docker/desktop/docker.sock. Is the docker daemon running?
This was bothering mebecause it seamed that I was not able to really stop docker, however, I notice that after stopping the docker daemon with systemctl I got the following message:
Warning: Stopping docker.service, but it can still be activated by:
docker.socket
so, decided to try stopping docker.socket (to which I have not found any documentation) with
sudo systemctl stop docker.service
and then, when I tried to run a docker command I would get what I would expect when I try to stop de docker daemon
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I have not been able to find information on docker.socket and I do not know what it is, if it is a sub process of another process, a service o something else, any help is appreciated.