简体   繁体   中英

Is it possible to run ASP.NET Core application in IBM Containers for Bluemix?

What would the Dockerfile look like in order to run an ASP.NET Core (formerly ASP.NET 5) app in a Bluemix container?

I tried https://github.com/aspnet/Home/blob/dev/samples/1.0.0-rc1-update1/HelloWeb/Dockerfile and wasn't able to access my app on my public IP address.

Kestrel is listening on localhost but Docker is forwarding requests to the container's 0.0.0.0 network interface. You can fix this by adding --server.urls to the ENTRYPOINT instruction:

ENTRYPOINT ["dnx", "-p", "project.json", "web", "--server.urls", "http://0.0.0.0:5000"]

Also IBM Containers for Bluemix may be blocking the port you are trying to expose, for example 5000. You can fix this by running your image with the -p option:

cf ic run -p <public IP>:80:5000 registry.ng.bluemix.net/<namespace>/<image name>

Then in a web browser your app would be available at http://<public IP> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM