Skip to content

Instantly share code, notes, and snippets.

@johnnymillergh
Last active July 18, 2021 12:36
Show Gist options
  • Save johnnymillergh/98462b8ba421f916596085037fd7f0d2 to your computer and use it in GitHub Desktop.
Save johnnymillergh/98462b8ba421f916596085037fd7f0d2 to your computer and use it in GitHub Desktop.
Windows 10 Docker Errors & Solutions on WSL2
https://github.com/docker/for-win/issues/3171#issuecomment-554587817
This is /obviously/ not docker's problem (as best I can tell), it's probably not even hyperv's. Commenting here as this seems to be a frustrating and common end of journey for googlers. What follows is at least "one" of the resolutions/explanations.
On one of my machines the dynamic port range was not updated to the "new" start port, and I guess related to a resolved bug in windows has now "exposed" this as a serious problem (e.g.: I couldn't even bind to port 3000 for node dev -- access denied is I think a valid response, but it's not the typical "port in use" root cause).
Current dynamic port config:
> netsh int ipv[46] show dynamicport tcp
Unless you know you've mucked with these settings, and if it doesn't specify 49152 as "Start Port" and is set to 1025, it's not "current". I don't know if there is some kind of migration bug when they were patching this new value or what. Dynamic start port for udp was set correctly for example.
To set it to the current config:
> netsh int ipv[46] set dynamic tcp start=49152 num=16384
(Likely a reboot of your host is required.)
ref: https://support.microsoft.com/en-ca/help/929851/the-default-dynamic-port-range-for-tcp-ip-has-changed-in-windows-vista
While it's bizarre that I only just ran into this issue less than 4 hours ago -- been doing docker/node/go dev for the last few months straight, using docker edge, etc. This appears to have resolved my port exclusion issues (I have no large ranges of reserved ports below 50000 now, previously had 1000 port range exclusions all over the place.)
Error
ERROR: for maf-rabbitmq Cannot start service rabbitmq: Ports are not available: listen tcp 0.0.0.0:61613: bind: An atte
mpt was made to access a socket in a way forbidden by its access permissions.
ERROR: for rabbitmq Cannot start service rabbitmq: Ports are not available: listen tcp 0.0.0.0:61613: bind: An attempt
was made to access a socket in a way forbidden by its access permissions.
ERROR: Encountered errors while bringing up the project.
`docker-compose` process finished with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment