Reputation: 844
Say we have frontend
and backend
containers based on Docker Desktop (for Windows).
Backend
container uses port 9001
, and the frontend
container listens to 9001
.
The problem is that port 9001
is already in use by Windows 10 by the Intel driver, and it is impossible to run a container on this port:
Error response from daemon: Ports are not available: listen tcp 0.0.0.0:9001: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Could you please advise what is the way to handle this port if there is no ability to change it directly from application code?
Upvotes: 6
Views: 13244
Reputation: 576
From another thread, this was the solution on windows for a similar error message:
net stop winnat
docker start container_name
net start winnat
Upvotes: 5
Reputation: 4253
A couple of ways:
docker run
command, specify the host port to use, and set it to something other than 9001
. i.e. -p 9002:9001
or Docker Compose
, i.e.ports:
- '9002:9001'
Then use port 9002
instead of 9001
when accessing the container from the host (Win 10).
9001
port.Upvotes: 2