Home > Net >  cannot access webapp running in docker
cannot access webapp running in docker

Time:06-22

I followed a enter image description here

In particular it shows ASPNETCORE_URLS=http:// 80, although I overwrote that above using -e ASPENTCORE_URLS=https://5000.

CodePudding user response:

The options on docker run are split up in 2 parts:

  • Options before the image name are docker options
  • Options after the image name override any CMD and is sent to the container

So your command should look like this

docker run -p 5000:5000 -p 5001:5001 -e ASPNETCORE_HTTP_PORT=https:// :5001 -e ASPNETCORE_URLS=http:// :5000 myrepo/demo:latest

EXPOSE doesn't actually do anything. It's mostly documentation about what ports you think the container uses. It can be wrong and if it's wrong you don't get any errors or warnings.

  • Related