[Solved] Docker does not start on clean image on RaspberryPi3

Having issues with your DietPi installation, or, found a bug? Post it here.
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by MichaIng »

Thanks for report and solution.
Will be fixed with next release :).
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by Garret »

mspieth wrote: Tue Nov 13, 2018 12:49 pm Until the bug is fixed within dietpi, it's easy to fix on your own.

1. Install docker #162 normally via dietpi-software.
2. At the end of the install, docker will fail to start, thats ok for now.
3. nano /lib/systemd/system/docker.service
4. Find the line that says: ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H fd://
5. Either delete that line or comment it out by adding a # in front of the line.
6. Add the following line just below the original line: ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H unix://
7. Save the file
8. service docker start

That's it.
You could also just edit the above mentioned file and replace the fd:// with unix://
To me it still does not work by doing in this way with a fresh new installation of DietPi. Even if I give "systemctl daemon-reload" and then "service docker start" or in the opposite order.

Code: Select all

root@dietpi:~# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
root@dietpi:~#
My "/lib/systemd/system/docker.service"

Code: Select all

...
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H unix://
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
...
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by MichaIng »

Did you do:
systemctl daemon-reload
before restarting the service? At best do this via:
systemctl restart docker
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by Garret »

MichaIng wrote: Sun Nov 18, 2018 6:56 pm Did you do:
systemctl daemon-reload
before restarting the service? At best do this via:
systemctl restart docker
@MichaIng Yes, I had already done that as I wrote in my previous message but I did it again now after rebooting the raspberry pi. Still Docker does not work.

Code: Select all

root@router:~# nano /lib/systemd/system/docker.service
root@router:~# systemctl daemon-reload
root@router:~# systemctl restart docker
Job for docker.service canceled.
root@router:~# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
   Active: failed (Result: core-dump) since Sun 2018-11-18 20:48:51 CET; 6s ago
     Docs: https://docs.docker.com
  Process: 9258 ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H unix:// (code=dumped, signal=SEGV)
 Main PID: 9258 (code=dumped, signal=SEGV)
      CPU: 625ms

Nov 18 20:48:48 router systemd[1]: Starting Docker Application Container Engine...
Nov 18 20:48:51 router systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Nov 18 20:48:51 router systemd[1]: Stopped Docker Application Container Engine.
Nov 18 20:48:51 router systemd[1]: docker.service: Unit entered failed state.
Nov 18 20:48:51 router systemd[1]: docker.service: Failed with result 'core-dump'.
root@router:~#
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by MichaIng »

docker.service: Main process exited, code=dumped, status=11/SEGV
Okay so there is anther issue then. Please check docker logs for more details.
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by Garret »

MichaIng wrote: Sun Nov 18, 2018 8:52 pm
docker.service: Main process exited, code=dumped, status=11/SEGV
Okay so there is anther issue then. Please check docker logs for more details.
Sorry I am very newbie to Docker. May I ask what should I do exactly?
iaresee
Posts: 9
Joined: Fri Nov 23, 2018 10:53 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by iaresee »

Found this post because I'm struggling to get docker running under dietpi on my RPi3 as well.
Garret wrote: Sun Nov 18, 2018 8:55 pm Sorry I am very newbie to Docker. May I ask what should I do exactly?
So under systemd the command to run is:

Code: Select all

journalctl -fu docker.service
For me, on my system, where dockerd is failing to start this doesn't really give me anything useful:

Code: Select all

root@pi-hole:~# journalctl -fu docker.service
-- Logs begin at Thu 2016-11-03 17:16:44 GMT. --
Nov 23 22:20:08 pi-hole systemd[1]: Starting Docker Application Container Engine...
Nov 23 22:20:12 pi-hole systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Nov 23 22:20:12 pi-hole systemd[1]: Stopped Docker Application Container Engine.
Nov 23 22:20:12 pi-hole systemd[1]: docker.service: Unit entered failed state.
Nov 23 22:20:12 pi-hole systemd[1]: docker.service: Failed with result 'core-dump'.
Nov 23 22:20:27 pi-hole systemd[1]: Starting Docker Application Container Engine...
Nov 23 22:20:31 pi-hole systemd[1]: docker.service: Main process exited, code=dumped, status=11/SEGV
Nov 23 22:20:31 pi-hole systemd[1]: Stopped Docker Application Container Engine.
Nov 23 22:20:31 pi-hole systemd[1]: docker.service: Unit entered failed state.
Nov 23 22:20:31 pi-hole systemd[1]: docker.service: Failed with result 'core-dump'.
I have no core dumps in /var/lib/systemd/coredump/ on my host. I also seem to be missing systemd-coredumpctl or coredumpctl...
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by MichaIng »

Did you do the systemd unit change as mentioned above:

Code: Select all

sed -i 's|fd://|unix://|' /lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
iaresee
Posts: 9
Joined: Fri Nov 23, 2018 10:53 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by iaresee »

MichaIng wrote: Sat Nov 24, 2018 10:37 pm Did you do the systemd unit change as mentioned above
Yup.

Code: Select all

root@pi-hole:~# cat /lib/systemd/system/docker.service | grep ExecStart
ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H unix://
Also made certain /mnt/dietpi_userdata/docker-data existed and had suitable permissions on it.
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Docker does not start on clean image on RaspberryPi3

Post by Garret »

MichaIng wrote: Sat Nov 24, 2018 10:37 pm Did you do the systemd unit change as mentioned above:

Code: Select all

sed -i 's|fd://|unix://|' /lib/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
@MichaIng it has already been mentioned several times that what you wrote was tried.

Anyways, I found out that the problem is apparently in the latest version of docker for rapsberry pi(arm). I realized the problem was this after I still got it not working by installing it on a new diet pi installation but with the docker official script.

Thus, in order to make it working for the moment these are the steps I did:
Install dietpi image
Run docker install script
Run sudo apt-get install docker-ce=18.06.1~ce~3-0~raspbian

The last step downgrades installs the previous version of docker.
Source: https://github.com/moby/moby/issues/381 ... -439733278
Post Reply