2

How do I simply pull and run hello-world?

nicholas@mordor:~$ 
nicholas@mordor:~$ 
nicholas@mordor:~$ snap list docker
Name    Version   Rev   Tracking       Publisher   Notes
docker  20.10.14  1779  latest/stable  canonical✓  -
nicholas@mordor:~$ 
nicholas@mordor:~$ sudo docker pull hello-world
Using default tag: latest
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
nicholas@mordor:~$ 
nicholas@mordor:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy
nicholas@mordor:~$ 
nicholas@mordor:~$ sudo systemctl start docker
Failed to start docker.service: Unit docker.service not found.
nicholas@mordor:~$ 
nicholas@mordor:~$ sudo systemctl status docker
Unit docker.service could not be found.
nicholas@mordor:~$ 

see also:

https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker

Unit docker.service could not be found

3 Answers3

5

In my case, to remedy the "Unit docker.service could not be found" issue, I needed to run...

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

(Source: https://docs.docker.com/engine/install/ubuntu/)

1

It might be that the snap version of docker is just the docker client, and not the actual docker daemon and service. I recommend going to their site and trying to install it using their instructions as it'll likely have the full package

Instructions here for Ubuntu

1

For my case, after install Docker Desktop from .deb file, I ran

sudo apt-get install docker-ce

after that, I tried to run the service

systemctl start docker

and it works! Peviously after I ran sudo apt --fix-broken install when failed to install docker .deb file, it didn't mention the docker-ce is needed. And found out that docker-ce is needed later.

Yodi S.
  • 11
  • 3