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:
It works for you now because dietpi-software is the problem not the actual docker install. In /DietPi/dietpi/dietpi-software there is a line:
# Set container(s) locations in /lib/systemd/system/docker.service
sed -i "/ExecStart=\/usr\/bin\/dockerd/c\ExecStart=\/usr\/bin\/dockerd -g $G_FP_DIETPI_USERDATA\/docker-data -H fd:\/\/" /lib/systemd/system/docker.service
This line breaks docker startup. I'll post a bug report on github.
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.
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://