Docker Community Forums

Share and learn in the Docker community.

Docker in Raspberry Pi


#1

Hello,

I have a Raspberry Pi Model B Plus Rev 1.2, I try this to install DOcker:

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
usermod -aG docker pi

The try to execute docker, but have this error:

# docker run hello-world

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.`
See ‘docker run --help’.

I am missing something?

I will appreciate your help.

Kind regards.


(Gary Forghetti) #2

Issue a systemctl start docker and retry the docker run command.


#3

Thanks,

systemctl start docker

Job for docker.service canceled.

docker run hello-world

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See ‘docker run --help’.

Regards.


(Gary Forghetti) #4

Any error mesages when you issued the systemctl start docker command and got the Job for docker.service canceled. message?

You can also run the journalctl command to display the Docker service logs.

journalctl --no-pager -u docker.service

Look for any errors that may help to diagnose why the docker service will not start.


#5

Hi,
I had the same problem with my raspberry 2B+.
I always get a seg. fault (for dockerd) with the newest docker version (used the installation script from docker.com on a fresh raspbian stretch installation).

I did a downgrade:

sudo apt-get install docker-ce=18.06.1~ce~3-0~raspbian

See https://github.com/moby/moby/issues/38175

At least the ‘dockerd’ started without errors except the following ‘warnings’ in the Docker service logs:

level=warning msg=“Your kernel does not support swap memory limit”
level=warning msg=“Your kernel does not support cgroup cfs period”
level=warning msg=“Your kernel does not support cgroup cfs quotas”
level=warning msg=“Your kernel does not support cgroup rt period”
level=warning msg=“Your kernel does not support cgroup rt runtime”
level=warning msg=“Unable to find cpuset cgroup in mounts”
level=warning msg=“mountpoint for pids not found”

But, running the ‘hello-world’ example produces no output :thinking:
Return value is ‘139’
Any ideas what’s going wrong here ?
Thanks in advance.


(Gary Forghetti) #6

Hi. Saw this article -> https://blog.raveland.org/post/docker_raspian/
Take a look, it looks like it might help you.
I saw this in the article:

We can get rid of some of these warnings.

Modify the /boot/cmdline.txt, add these two parameters : cgroup_enable=memory swapaccount=1 and reboot



#7

Thank you for the hint.
I modified my ‘/boot/cmdline.txt’ and some warnings disappeared from the end of the ‘docker info’ output.

But still the ‘hello-world’ example does not work (no output on console).


(Gary Forghetti) #8

Saw this too which makes sense.

Make sure you use this image armv6l/hello-world.

docker run armv6l/hello-world


#9

Hello Gary,
again thank you for that hint.
This pushed me in the right direction…

For my raspberrypi 2+: ‘ARMv6-compatible processor rev 7 (v6l)’
the following image works
‘arm32v5/hello-world’ :star_struck:

Maybe a hint under https://github.com/docker-library/official-images#architectures-other-than-amd64
for ‘ARMv5 32-bit (arm32v5)’ and Raspberry 2x would be helpful.

Again thank you very much for your support.


(Gary Forghetti) #10

Awesome! Glad to hear it.

I just purchased a Raspberry PI 3 B+.
Hoping to get Docker up and running on it.


(Gary Forghetti) #11

Done. Submitted a Pull request with that update for the ‘ARMv5 32-bit (arm32v5)’ and Raspberry 2x