Reduce publish slug size
@jincod As I am also having an issue of large slug size similar to #19 , I have implemented logic to reduce the slug size when publish to heroku. In my case, the slug size is reduced from 470MB to 81MB.
It is done by publishing a self-contained dotnet app instead of embedding the whole dotnet core runtime into the slug, hence the great reduction in size. See if you could accept this PR, thanks 😄
Thank you for working on this! Slug size has been an issue for me as well.
Hi @lppkarl
Many thanks for your contribution!
I'll review it.
@lppkarl I've tried this but it still outputs a .dll (which can't be executed) - is there some additional config i need to change in my project?
@chrisanderton Maybe you have targeted a wrong framework? The publish command generates executable (with no extension) only when you're targeting netcoreapp instead of netstandard
hmm @lppkarl i'm targeting netcoreapp1.1 - but tbh i'm not so strong on dotnet - does this only work with 2.0?
@chrisanderton As I see it, --self-contained tag only works for netcoreapp2.0, you may migrate your project from 1.1 to 2.0. See https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/ 😄
@lppkarl , I'm currently using your pull request link for buildpack and it reduces my heroku app slug size from 430MB to 40MB. My app is .net core app 2.0. Great works!
Hi @lppkarl
Would be great to do this feature optional export SELF_CONTAINED=${SELF_CONTAINED:-false} for example. Could you please implement it?
Also I've added env var DOTNET_SKIP_FIRST_TIME_EXPERIENCE (https://github.com/jincod/dotnetcore-buildpack/blob/master/bin/compile#L28) which helps to reduce slug size.
@jincod ya, I could help implement it.
I'm interested in how DOTNET_SKIP_FIRST_TIME_EXPERIENCE help reduces slug size? Is there a mechanism for heroku to cache its installation files or restored file so that the process is not done again for second time onwards?
Hi @lppkarl
Thanka a lot! Ping me if you have any questions.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE dotnet core cli option. You can find more info here http://www.erikschierboom.com/2017/03/21/continuous-integration-of-dotnet-core-applications/