Skip to content

Asp net core port mapping #4393

Answered by mthalman
Simkiw asked this question in Q&A
Feb 6, 2023 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

You should be able to explicitly set the port via the docker run command by setting the ASPNETCORE_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:

docker run --rm -it -p 8000:9999 -e ASPNETCORE_URLS=http://+:9999 mcr.microsoft.com/dotnet/samples:aspnetapp

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mthalman
Comment options

@Simkiw
Comment options

@Simkiw
Comment options

@mthalman
Comment options

@Simkiw
Comment options

Answer selected by Simkiw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants