I have a Raspberry Pi 3 Model B where I just have put a clean install of DietPi. The system updates to v.6.17.12 and then I install only the Docker software via the Optimized software (#162 on the software list).
However, I can see this fails to start when the system reboots. This is confirmed also when I try to run a container:
root@livingroom:~/docker-transmission-openvpn# docker build -t transmission-openvpn -f Dockerfile.armhf .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
The “systemctl status docker -l” returns this message:
root@livingroom:~# systemctl status docker -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-11-10 12:08:47 CET; 10min ago
Docs: https://docs.docker.com
Process: 1166 ExecStart=/usr/bin/dockerd -g /mnt/dietpi_userdata/docker-data -H fd:// (code=exited, status=
1/FAILURE)
Main PID: 1166 (code=exited, status=1/FAILURE)
CPU: 297ms
Nov 10 12:08:45 livingroom systemd[1]: docker.service: Unit entered failed state.
Nov 10 12:08:45 livingroom systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 10 12:08:47 livingroom systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Nov 10 12:08:47 livingroom systemd[1]: Stopped Docker Application Container Engine.
Nov 10 12:08:47 livingroom systemd[1]: docker.service: Start request repeated too quickly.
Nov 10 12:08:47 livingroom systemd[1]: Failed to start Docker Application Container Engine.
Nov 10 12:08:47 livingroom systemd[1]: docker.service: Unit entered failed state.
Nov 10 12:08:47 livingroom systemd[1]: docker.service: Failed with result 'exit-code'.
root@livingroom:~#
Do you have an idea why this happens and if it can be fixed?
Thanks mspieth, I had figured out that the problem was in the dietpi-software. I am happy now because in the end I managed but I hope they can fix it so next time I can install docker from the optimized software.
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.
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”
...
[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
...
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.
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:~#
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