-
Hi, I have been looking for hours why my web api does not listen to my container port other than 80. I found this information on stackoverflow however, when i tried to find it by myself, I couldn't. Usually, the docker image decription in the docker hub presents the necessary information that would help run the container, in my case, it wasn't : docker run -p hostPort:containerPort works only if I map it to 80, otherwise there is an extra step to go over. As a developer who would like to write .net apps and containerize them, what are the things I should configure and how can i find the information, like that environment variable which in my opinion is very important. Anyway, I just try to understand why is it necessary to go through that env variable and how I can find the information again. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
You should be able to explicitly set the port via the
|
Beta Was this translation helpful? Give feedback.
You should be able to explicitly set the port via the
docker run
command by setting theASPNETCORE_URLS
variable. Here I set the app in the container to listen on port 9999 and map that to port 8000 on my host machine: