I am new to docker and I have 2 windows machines on windows 10 . I wish to expose all ports as I am running multiple services and they are internally calling other NodeJS services .
SO I did on windows PowerShell
docker run -dit -p 3000:3000 -p 6379:6379 --name manish1v manish1:1.0
This exposed port 3000 of my service and redis port 6379 . however it needs another port which comes up randomly
Sometimes that port is 6000 and sometimes 6001 sometimes something ransom . When I had exposed -p 6000:6000 and internally it was 6000 everything works . If it does not match things goes for a toss.
How can I expose all ports mapped to same ports on windows .
I tried 2 things
- docker run --network host
unfortunately it is not supported on windows it seems
- docker run -P
unfortunately it is not working . Because it seems it exposes on random ports but I want them to be exposed on same ports
Please help .