hypriot / image-builder-rpi

SD card image for Raspberry Pi with Docker: HypriotOS
http://blog.hypriot.com/post/how-to-get-docker-working-on-your-favourite-arm-board-with-hypriotos/
MIT License
1.07k stars 168 forks source link

Docker service takes long to start #295

Closed Duvel closed 5 years ago

Duvel commented 5 years ago

I found out that with version 1.10 installed on some devices it could take docker several minutes before it started. I was researching another issue with a service that wouldn't start at boot and found out that docker wasn't starting quickly. Checking the logs didn't help and adding debug didn't give any solution as well.

Then I went to check out the 1.11-rc2 and found that it was starting quickly and I tried to install that docker version on an 1.10 build.

The new docker version did give me a hint, why it wasn't starting:

crypto/rand: blocked for 60 seconds waiting to read random data from the kernel

Then I installed haveged, which sometimes is also needed for hostapd, and that seemed to solve my problem and docker start immediately.

StefanScherer commented 5 years ago

So, it doesn‘t take too long with 1.11.0-rc2?

Duvel commented 5 years ago

For now the 1.11.0-rc2 looks good, but I haven't tested it yet on a Raspberry Pi 0 W, where I first found the problems. In fact I'm not using docker yet on these machines, so that could be part of the problem.

Duvel commented 5 years ago

Found the time to do some testing. It also occurs with the 1.11.0-rc2.

It happens probably because I remove cloud-init, as I take over with ansible after the first boot.

Duvel commented 5 years ago

Confirmed it now on a Raspberry Pi 1, only removing cloud-init makes docker wait for the system to get enough randomness.