Beginners Tutorial: Docker with ASP.NET Core
--updated to .net core 2.0--
--updated with multi-stage builds --
In this tutorial, you wi...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for writing this. It was a huge help.
A few things for others who come along later:
I'm running windows 10 pro with VS 2017 installed
As of now the dockerfile will build but not run b/c dotnet sets up the project looking for framework version 1.1.2. To fix the dockerfile just change the from line by adding the tag for image 1.1.2 and you'll be good to go.
Also, you can use a multistage docker file to build your image so you can skip a few steps in the post. Looking at at documentation provided by Microsoft on their aspnetcore-build image you'll see how to do it. However, you still have to tag the final from with the correct framework or you won't run.
Again: thanks for writing this Bastian. Great job!
finally updated with multi-stage build docker files. should have looked at it when u suggested it :(
thanks for the praise. sorry for taking so long to reply. i updated the article with the 1.1.2 tag. Though i should probably update to to 2.0...
Nice tutorial. It would be great to have the behind-the-scenes explained a little better for the build. I think I get it, the docker build image copies the entire directory (except out and bin which are in ignore file) into an image 'docker-tutorial-build', then a container is created for that image, the build is performed (restore/publish), then out is copied into the local filesystem, then the image is built. Basically just replacing the 'dotnet publish' with creating an image and a container, performing the build in the container, then copying the results back out.
I was thinking originally what you were going to show was to create a container to let the build happen when it is run...
sorry for the late reply. yes, i could have explained that a bit better. I might just add your nice and correct summary to the article :)
How to Add to this solution dockerfile linux-sql-server ?
i am not sure i completely understand, but i am guessing you are asking how you would start a mssql server in a container?
in that case you would simply run something like this:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -e 'MSSQL_PID=Express' -p 1433:1433 -d microsoft/mssql-server-linux:latest
Check out the docs here: hub.docker.com/r/microsoft/mssql-s...
here is a quick example: github.com/schwamster/mssql-docker
Hope this is what you were looking for
is there a way to show the full website instead of just those values?
if you are talking about the boring endpoint that only responds with ["value1","value2"] then the simple answer is - absolutly, but then u got to either change the project template used when creating the core project (e.g. dotnet new mvc) or simply output something different in the Values controller. The project that is created with dotnet new webapi does not have a ui though
Hi, How to change environtment to development stages?