Docker noob here...
How does one properly run the docker image of your Asp.Net CORE app which is produced by Visual Studio 2017 at the command line?
docker run -it -d -p 80:32769 myappimage
does not appear to work properly (image runs, but I cannot browse to my app)
Note: I've simply created a sample ASP.Net Core Web App within Studio using the default template, and added Docker support (by clicking the "Add Docker support" checkbox.). Studio adds a dockerfile and some docker-compose files when you do this.
When Visual Studio "runs" the image (by pressing F5) - I can successfully browse to my application ( via "http://localhost:32789" or similar host port. App inside container is on port 80 ). But I cannot figure out the command to run it myself at the command line.
The standard Dockerfile that Studio adds to your project is...
FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "WebApplication2.dll"]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…