Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to package ASP.NET vNext projects and run elsewhere?

I know that in an ASP.NET vNext project directory (where project.json exists), we can execute k run (or k web depending on the configuration/code) and KRuntime runs/starts the application/server.

I also realized that kpm build creates a *.nupkg from your ASP.NET vNext project. That seemed like a sort of packaging to me and I can ship using that. However I couldn't find the correct way to bundle an app with all its dependencies and make it runnable with one command. Is there a way to do this?

My use case will be building a Docker image that has Mono and will just drop the built ASP.NET vNext application in it and provide the entrypoint for the web server with one-liner command, like k web. I looked at a few examples but I couldn't find a way to bundle an app with all its dependencies.

like image 344
ahmet alp balkan Avatar asked Jun 25 '14 01:06

ahmet alp balkan


1 Answers

KPM pack is what you want. It will create a "deployment image" and a batch script (we don't support .sh yet but will eventually). There's likely a few bugs you will run into on mono:

  1. https://github.com/aspnet/KRuntime/issues/272
  2. https://github.com/aspnet/KRuntime/issues/327
like image 109
davidfowl Avatar answered Nov 15 '22 04:11

davidfowl