Bumped into another weird issue running Docker on Windows 10. I kept getting error messages like this after a reboot, issuing my usual docker run command for my react dev image.
docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint jolly_raman (72401c26badafe346452278b7a5e756a6872cf90516a5d0fc155979d9f0f2a91): Bind for 0.0.0.0:3000 failed: port is already allocated.
Doing a docker ps did show the image was running, but attempting to open http://localhost:3000 in my browser didn’t work? WTF?!!
To work around it I would restart the docker daemon, but that quickly became annoying. Turns out the cause has something to do with Windows 10 fast startup…
TL;DR just turn off the fast startup option in the control panel if you are using docker with Windows 10. It will save you a tonne of headache.
From the Microsoft docs, it sounds as though Windows is attempting to restore the state of memory/hardware as at the time of the shutdown. This doesn’t seem to agree with the way Docker works.
a fast startup simply loads the hibernation file (Hiberfil.sys) into memory to restore the previously saved image of the Windows kernel and loaded drivers. A fast startup tends to take significantly less time than a cold startup.
After turning fast startup off, everything is working perfectly. Hoping this helps others running docker on Windows 10.
