New to Docker. I am running Visual Studio 2019 community on Win 10 machine. Installed Docker desktop and created two solutions (service1 and service2). I am trying to run both of the solutions on their own containers.
I was able to build and run service1 using:
docker run -it --rm -p 3000:80 --name mymicroservicecontainer mymicroservice
Question what is 3000:80? is 80 a port? because I was able to run my api using http://localhost:3000/api/product/1 from browser.
Next, I am trying to run service2 on it's own container by:
docker run -it --rm -p 2000:80 --name myanotherservicecontainer myanotherservice
Since the port is 2000, I guess it should work however I get following error:
docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:2000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
time="2020-04-08T14:22:41-04:00" level=error msg="error waiting for container: context canceled"
Is that because I have :80 same as service1? What is the solution? I am running commands on admin mode in command prompt.
Please help. Thank you.
Question what is 3000:80?
docs.docker.com/engine/reference/commandline/run/… – tkausl