Last active
September 8, 2017 00:52
-
-
Save sethbunke/eb2bda3c827e14137a97d3dfa87d3c63 to your computer and use it in GitHub Desktop.
Build DotNet Core Docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://dev.to/schwamster/docker-tutorial-with-for-aspnet-core | |
dotnet new webapi | |
dotnet restore | |
dotnet publish -o ./publish | |
#IN DOCKERFILE | |
FROM microsoft/aspnetcore | |
WORKDIR /app | |
COPY ./publish . | |
ENTRYPOINT ["dotnet", "docker-tutorial.dll"] | |
docker build -t docker-tutorial . | |
docker run -p 8181:80 docker-tutorial | |
http://localhost:8181/api/values | |
#Get IP address of container | |
docker inspect --format '{{ .NetworkSettings.IPAddress }}' GET-THE-NAME-FROM-DOCKER-PS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment