Friday 24 November 2017

How to run a .Net core app using docker

For Windows 10 User(see below for windows 7,8 user):

  1. Click on Docker for windows and start docker.

  1. Navigate to Docker on your tray and click “Switch to linux container”

  1. Open command prompt: Type “docker run hello-world”. You  should get below message.



For Windows 7,8 user

  1. Click on and start the docker

  1. On the docker prompt: Type “docker run hello-world”. You  should get below message.

  1. Navigate to Folder using command prompt or docker command prompt(windows 7,8 user) where you copied the  linuxcoreimage.tgz and aspnetcoreimage.tgz

  1. Run below command to load the image to your system.

docker load < linuxcoreimage.tgz
docker load < aspnetcoreimage.tgz

  1. Download the .Net core/Angular project  project from the github(Make sure git is installed)


  1. Create a file named as “DockerFile” without any extension inside the aspnetapp.

  1. Add content as shown below


  1. Open command prompt or docker command prompt(windows 7,8 user)

  1. Navigate to the folder in the (docker)command prompt where the dockerfile was created

docker build -t netcorewebapi .
docker run -t -p 8080:80 netcorewebapi:latest

  1. For windows 10: Navigate to http://localhost:8080


  1. For windows 7,8: Navigate to http://192.168.99.100:8080/


No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Build Bot using LUIS