Verify that dockerd is running
Assuming docker in installed (sudo apt install docker.io
or like this), you should see a running daemon in the process list:
$ ps axuf | grep docker
root 7694 0.2 0.2 1932540 75504 ? Ssl Apr28 4:19 /usr/bin/dockerd -H fd://
root 7721 0.2 0.1 1917924 38596 ? Ssl Apr28 3:12 \_ docker-containerd --config /var/run/docker/containerd/containerd.toml --log-level info
If not, try to start/restart the daemon with:
$ sudo systemctl restart docker
$ systemctl show docker | grep State
StateDirectoryMode=0755
LoadState=loaded
ActiveState=active
SubState=running
...
If the daemon fails to start, check the output of journalctl -u docker
for error messages.
Add user to group
The user you are working with, must be in the docker
group. Check you current group membership with:
$ groups
username adm cdrom sudo dip plugdev lpadmin sambashare docker
If you are not part of the docker
group add you current user with:
$ sudo adduser $(whoami) docker
Logout and login again for the changes to take effect.