You are not logged in.

#1 2024-03-10 05:58:46

cschep
Member
Registered: 2006-12-02
Posts: 125
Website

[SOLVED] Docker takes many minutes to start?

when running

sudo systemctl start docker.service

the first time after rebooting it takes forever, like 5 minutes.

stopping and starting after that work instantly.

I have googled and poked around but I have no idea what to do next. Anyone seen this before?

Last edited by cschep (2024-03-11 19:51:11)

Offline

#2 2024-03-10 06:14:45

yataro
Member
Registered: 2024-03-09
Posts: 93

Re: [SOLVED] Docker takes many minutes to start?

You should check the docker logs:

journalctl -eu docker.service

which operation takes the longest time?
If the information is insufficient, try enabling debug https://docs.docker.com/config/daemon/l … -debugging

Offline

#3 2024-03-10 07:02:54

Mr.Smith1974
Member
Registered: 2013-04-13
Posts: 44

Re: [SOLVED] Docker takes many minutes to start?

How much space do all your containers and images take up? Have you tried to do "docker system prune"?

Offline

#4 2024-03-11 15:55:40

cschep
Member
Registered: 2006-12-02
Posts: 125
Website

Re: [SOLVED] Docker takes many minutes to start?

yataro wrote:

You should check the docker logs:

journalctl -eu docker.service

which operation takes the longest time?
If the information is insufficient, try enabling debug https://docs.docker.com/config/daemon/l … -debugging

Thank you! So this is a weird thing.. when I execute the systemctl start command nothing appears in the journalctl logs for many minutes then bam it happens quickly.

Mar 11 11:51:43 tormund systemd[1]: Starting Docker Application Container Engine...
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.412870543-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.413342776-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.467713949-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.468646685-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.577142398-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.606793017-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.660300835-04:00" level=warning>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.660415965-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.660576397-04:00" level=info ms>
Mar 11 11:51:43 tormund dockerd[119325]: time="2024-03-11T11:51:43.681422720-04:00" level=info ms>
Mar 11 11:51:43 tormund systemd[1]: Started Docker Application Container Engine.

Once it sits for many minutes... it finally hit starts then as you can see starts in like one second.

How much space do all your containers and images take up? Have you tried to do "docker system prune"?

So this is a fresh install of Docker, never pulled a single image/container/anything.

Offline

#5 2024-03-11 15:57:57

cschep
Member
Registered: 2006-12-02
Posts: 125
Website

Re: [SOLVED] Docker takes many minutes to start?

Also -- this only happens the first time. Once I wait the 5 minutes and Docker finally comes up I can stop/start it all I want.. My gut says some sort of network timeout but... I don't know how to troubleshoot.

Offline

#6 2024-03-11 19:50:10

cschep
Member
Registered: 2006-12-02
Posts: 125
Website

Re: [SOLVED] Docker takes many minutes to start?

SOLVED!

Turns out

systemd-network-wait-online

was taking two minutes to timeout and failing every time. I noticed that docker.service had this as a dep by using the command:

systemctl list-dependencies docker.service

I have two network cards, ethernet and wireless. The default for systemd network wait is to make sure all interfaces are up. I only use ethernet this is a desktop that doesn't need a wireless connection. I would love to disable the wireless card (and bluetooth for that matter) but it turns out to be a well known firmware flaw on this MSI board that there is no option to do that.

so! I was able to update systemd to consider any interface to be up not ALL of them. weird default but whatever.

This ended up being really helpful in case anyone stumbled upon this in the future: https://unix.stackexchange.com/question … ne-failure

Thanks all!

Offline

#7 2024-07-31 10:12:36

slightlyfaulty
Member
Registered: 2020-09-03
Posts: 1

Re: [SOLVED] Docker takes many minutes to start?

Thanks very much for posting your findings and solution. Finally I can put this annoying issue to rest.

Offline

#8 2026-03-01 04:28:17

wiperr
Member
Registered: 2026-03-01
Posts: 1

Re: [SOLVED] Docker takes many minutes to start?

Thanks for the answer, it really helped me. I was tired of waiting 2 minutes everytime I ran wsl

Offline

#9 2026-03-01 11:56:39

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,332
Website

Re: [SOLVED] Docker takes many minutes to start?

Mod note: closing this old solved topic to prevent further necrobumps.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB