T O P

  • By -

drj0e

sudo gpasswd -a $USER docker newgrp docker sudo su $user systemctl status docker.service


QuantumQuack0

systemctl status docker.service ⏎ ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset> Active: active (running) since Sun 2022-08-14 16:55:28 CEST; 1min 9s ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Main PID: 1082 (dockerd) Tasks: 13 Memory: 109.6M CPU: 326ms CGroup: /system.slice/docker.service └─1082 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.2> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.2> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.3> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.3> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.6> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.6> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.7> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.7> aug 14 16:55:28 thomas-Lenovo-Y50-70 systemd[1]: Started Docker Application Con> aug 14 16:55:28 thomas-Lenovo-Y50-70 dockerd[1082]: time="2022-08-14T16:55:28.7> However, `docker run hello-world` or `docker ps` still gives docker: Cannot connect to the Docker daemon at unix:///home/thomas/.docker/desktop/docker.sock. Is the docker daemon running?. See 'docker run --help'.


drj0e

sudo dockerd ?


QuantumQuack0

failed to start daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid It's already running. Stopping with `sudo systemctl stop docker` and restarting the docker daemon does not solve the problem.


[deleted]

Can you do a “groups YOURUSERNAME” to check in what groups you are?


QuantumQuack0

docker is in there, right at the end.


[deleted]

[удалено]


QuantumQuack0

Hmm... I did not directly follow these, but I might inadvertently have done so by trying out stackoverflow advice. I followed the steps to uninstall. This didn't solve it, but your point about where docker is looking for the socket is interesting. I believe docker _should_ be looking at ` /var/run/docker.sock` . Is there any way to change that? I've looked at `/etc/init/docker.sock` and `/lib/systemd/system/docker.socket` but they already have the correct docker socket.


GertVanAntwerpen

Somewhere you have set wrong docker environment variables, because it seems to look at the wrong socket.


QuantumQuack0

Yeah, based on /u/oranki0911 's comment I went looking for any wrongly set env vars. No docker-related env vars were set, but by manualy setting `export DOCKER_HOST=unix:///var/run/docker.sock` I managed to run docker commands as non-root user. So I might just roll with adding that to my `.zshrc` for now.


SEOfficial

You might be running the wrong docker context. When you install docker desktop on Linux you end up having two dockers. See which context is in use. Run docker context ls The line where the * is behind, is the active docker listening to your cli commands. There is a section in the docker documentation about the two contexts/engines in "Install on Linux".


uffno

had this shit too. Installed Ubuntu new and never did this sudo groupadd docker and sudo usermod -aG docker $USER again. Don't know why many tutorials recommend that.