2

If I create a .NET Core self-contained deployment (SCD) ...

dotnet new console
dotnet publish -c RELEASE -r linux-x64

... I get a folder with 186 files.

enter image description here

(List of all files https://gist.github.com/dhcgn/15e3cf44b2e0c76e8b8d76d32e01f4e7)

How can I pack these files in one executable for linux?

Babak Naffas
  • 12,395
  • 3
  • 34
  • 49
hdev
  • 6,097
  • 1
  • 45
  • 62
  • See https://github.com/dotnet/cli/issues/7737. Basically, it will rely on CoreRT. I am not sure if that is production ready yet. – omajid Feb 22 '18 at 20:59
  • Oh, and with the linker, you can get down to a few dozen files instead of hundreds: https://github.com/dotnet/announcements/issues/30 – omajid Feb 22 '18 at 21:00
  • What about 'packer for executables' is there not a simple tool to pack a bunch of files with the possibility to execute? – hdev Feb 23 '18 at 09:09

1 Answers1

2

Update There is an open feature request for publishing a dotnet application to one self contained executable file

Original Answer Short answer, to my knowledge, is that you can't get a "single file" self contained deployment package.

The generated directory contains your self contained deployment package with a linux executable file that matches your project name. That executable will run on a compatible Linux server without installed dependencies. Scott Hanselman did a nice write up about self contained deployments.

Babak Naffas
  • 12,395
  • 3
  • 34
  • 49