Skip to content

Instantly share code, notes, and snippets.

@sethbunke
Last active September 8, 2017 00:52
Show Gist options
  • Save sethbunke/eb2bda3c827e14137a97d3dfa87d3c63 to your computer and use it in GitHub Desktop.
Save sethbunke/eb2bda3c827e14137a97d3dfa87d3c63 to your computer and use it in GitHub Desktop.
Build DotNet Core Docker image
#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