You can use dnu publish --runtime <name of runtime> --no-source . This creates a folder with your application, its dependencies and runtime. Then all you have to do is get this folder on your server.
How you really move files depends on your scenario ... It could be FTP, Storage, Kudu (if you're on Azure WebSites), etc.
Another alternative is server recovery. Although this reduces the size of the application when publishing, you will have to restore packages on the server, which may be unsafe, and may also lead to application termination, as feeds may have newer, incompatible packages.
While there is no correct answer to fit all, I have found that if you want to get the most reliable and consistent results, you should publish everything, test it locally, and then just copy the package to your server.
For dockers, I recommend the same. Publish with runtime and without sources and create a container with the resulting folder.
Victor Hurdugaci
source share