Running Docker for Windows, Error when exposing Ports

后端 未结 10 1519
天命终不由人
天命终不由人 2021-01-31 01:10

I am aware there are a lot of questions about running Docker on windows, however this question is about running the brand new Docker for Windows, on Windows.
In my case I am

相关标签:
10条回答
  • 2021-01-31 02:05

    Here's a new twist.

    The last Windows 10 update (Fall Creators Update, 2017) has a new "feature". It automatically starts any applications that were running when you last shutdown.

    This reconstitutes Docker for Windows in a bad state. That made it appear those ports were in use by something else - it was the ghost of itself. This explained why those ports were still in use even though I stopped/started my containers and even reboot!

    The solution in this case is to simply restart Docker daemon.

    To prevent this after the next shutdown, don't use the shutdown button. Type this instead:

    shutdown /s /t 0
    

    This bypasses the new feature.

    See the answer from Jason[MS] in this thread:

    https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_perf-insiderplat_pc/programs-autostart-after-boot-in-windows-10-fall/09dd8d3e-7b36-45d1-9181-6587dd5d53ab

    Here's one guy's workaround (from the end of this thread - haven't tried it myself):

    http://www.icttoolbox.nl/info/stop-windows-10-creator-fall-reopening-programs-reboot/

    0 讨论(0)
  • 2021-01-31 02:08

    This is caused by a port numbering conflict: github issue here https://github.com/docker/compose/issues/3277

    Essentially the port is in use! The reason resetting worked is because it wiped other mappings off.

    0 讨论(0)
  • 2021-01-31 02:11

    I tried all the suggestions on this issue: killing all the containers, restarting Docker Desktop, disabling "Fast Startup," restarting my computer, making sure "Experimental Features" were disabled. None of that stuff worked.

    I did eventually get it running. Here are some things you may want to try (because I'm not sure what actually fixed it).

    1. Find "Docker Desktop" and right-click to "Run as Administrator..."
    2. Pay attention to the port that it's complaining about. Some people say this could just be Docker's unfriendly way of saying "that port is in use." In my case, the port was 80. I went into the Services on Windows Pro and disabled the "World Wide Web Publishing Service" just to be safe.
    0 讨论(0)
  • 2021-01-31 02:13

    Restarting the Docker daemon fixes this problem temporarily, but to get rid of it ultimately I had to disable Windows 10 fast startup, which is the feature @biscuit314 described.

    To disable Windows 10 fast startup, get to the Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable > Uncheck Turn on fast startup (recommended) and hit Save changes

    0 讨论(0)
提交回复
热议问题