Resolve Docker Error - Error response from daemon: Ports are not available

Solution for resolving a docker error that arises after WSL reboot.

Resolve Docker Error - Error response from daemon: Ports are not available
Photo by David Pupăză / Unsplash

Error

Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3306 -> 0.0.0.0:0: listen tcp 0.0.0.0:3306: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

Solution

restart winnnat

net stop winnat
net start winnat