Skip to content

Instantly share code, notes, and snippets.

@solrevdev
Created August 29, 2018 03:33
Show Gist options
  • Save solrevdev/19648d95a47c7a665e5b2b0dd2017e2b to your computer and use it in GitHub Desktop.
Save solrevdev/19648d95a47c7a665e5b2b0dd2017e2b to your computer and use it in GitHub Desktop.
now output with linker asp.net docker etc.
~/Code/github/now-examples/dotnetcore under solrevdev
> Synced 1 file (545B) [1s]
> https://dotnetcore-wvzsdtgcui.now.sh [in clipboard] (bru1) [6s]
> Building…
> Sending build context to Docker daemon 13.31kB
> Step 1/13 : FROM microsoft/dotnet:2.1-sdk-alpine AS build
> ---> 11a4b528481d
> Step 2/13 : WORKDIR /app
> ---> Using cache
> ---> 34d208ec67d9
> Step 3/13 : COPY *.sln .
> ---> Using cache
> ---> 56e830cba48c
> Step 4/13 : COPY aspnetapp/*.csproj ./aspnetapp/
> ---> Using cache
> ---> ce2f7b1edf36
> Step 5/13 : COPY aspnetapp/nuget.config ./aspnetapp/
> ---> 9149f3124e9c
> Step 6/13 : RUN dotnet restore
> ---> Running in da727700224a
> Restoring packages for /app/aspnetapp/aspnetapp.csproj...
> Installing ILLink.Tasks 0.1.4-preview-906439.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.props.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.targets.
> Restore completed in 5.09 sec for /app/aspnetapp/aspnetapp.csproj.
> Step 9/13 : RUN dotnet publish -c Release -o out -r linux-x64 /p:ShowLinkerSizeComparison=true
> ---> 4fb6fa53d872
> Removing intermediate container da727700224a
> Step 7/13 : COPY aspnetapp/. ./aspnetapp/
> ---> da209112ec4e
> Step 8/13 : WORKDIR /app/aspnetapp
> ---> df9fe675c830
> Removing intermediate container 9e29d6682198
> ---> Running in 24aa20a1af00
> Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> Restoring packages for /app/aspnetapp/aspnetapp.csproj...
> Installing Microsoft.NETCore.DotNetAppHost 2.1.2.
> Installing Microsoft.NETCore.DotNetHostResolver 2.1.2.
> Installing Microsoft.NETCore.DotNetHostPolicy 2.1.2.
> Installing Microsoft.NETCore.Targets 2.0.0.
> Installing Microsoft.AspNetCore.Identity.UI 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Core 2.1.2.
> Installing Microsoft.Extensions.Identity.Core 2.1.2.
> Installing Microsoft.AspNetCore.SignalR.Common 1.0.2.
> Installing Microsoft.AspNetCore.SignalR.Core 1.0.2.
> Installing Microsoft.AspNetCore.Http.Connections 1.0.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets 2.1.2.
> Installing Microsoft.AspNetCore.SignalR 1.0.2.
> Installing Microsoft.AspNetCore.SignalR.Protocols.Json 1.0.2.
> Installing Microsoft.Extensions.Identity.Stores 2.1.2.
> Installing Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Https 2.1.2.
> Installing Microsoft.AspNetCore.App 2.1.2.
> Installing Microsoft.NETCore.App 2.1.2.
> Installing Microsoft.AspNetCore 2.1.2.
> Installing Microsoft.AspNetCore.Connections.Abstractions 2.1.2.
> Installing Microsoft.AspNetCore.Http.Connections.Common 1.0.2.
> Installing Microsoft.AspNetCore.Server.Kestrel 2.1.2.
> Installing Microsoft.AspNetCore.Identity 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetAppHost 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.App 2.1.2.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.props.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.targets.
> Restore completed in 10.54 sec for /app/aspnetapp/aspnetapp.csproj.
> aspnetapp -> /app/aspnetapp/bin/Release/netcoreapp2.1/linux-x64/aspnetapp.dll
> Before linking (B) After linking (B) Size decrease
> ----------- ----------- ----------- -----------
> Total size of assemblies 69,756,408 40,999,936 41.224%
> ----------- ----------- ----------- -----------
> aspnetapp.dll 7,168 6,656 7.143%
> System.Net.Http.Formatting.dll 184,968 0 100.000%
> Microsoft.AspNetCore.dll 22,032 10,752 51.198%
> Microsoft.AspNetCore.Antiforgery.dll 54,264 0 100.000%
> Microsoft.AspNetCore.Authentication.dll 62,456 0 100.000%
> Microsoft.AspNetCore.Authentication.Abstractions.dll 29,176 5,632 80.696%
> Microsoft.AspNetCore.Authentication.Cookies.dll 48,120 0 100.000%
> Microsoft.AspNetCore.Authentication.Core.dll 37,880 6,144 83.780%
> Microsoft.AspNetCore.Authentication.Facebook.dll 26,616 0 100.000%
> Microsoft.AspNetCore.Authentication.Google.dll 28,144 0 100.000%
> Microsoft.AspNetCore.Authentication.JwtBearer.dll 36,856 0 100.000%
> Microsoft.AspNetCore.Authentication.MicrosoftAccount.dll 25,080 0 100.000%
> Microsoft.AspNetCore.Authentication.OAuth.dll 42,488 0 100.000%
> Microsoft.AspNetCore.Authentication.OpenIdConnect.dll 89,592 0 100.000%
> Microsoft.AspNetCore.Authentication.Twitter.dll 45,048 0 100.000%
> Microsoft.AspNetCore.Authentication.WsFederation.dll 45,048 0 100.000%
> Microsoft.AspNetCore.Authorization.dll 39,928 0 100.000%
> Microsoft.AspNetCore.Authorization.Policy.dll 20,472 0 100.000%
> Microsoft.AspNetCore.Connections.Abstractions.dll 32,760 6,656 79.683%
> Microsoft.AspNetCore.CookiePolicy.dll 26,104 0 100.000%
> Microsoft.AspNetCore.Cors.dll 36,336 0 100.000%
> Microsoft.AspNetCore.Cryptography.Internal.dll 40,952 0 100.000%
> Microsoft.AspNetCore.Cryptography.KeyDerivation.dll 21,496 0 100.000%
> Microsoft.AspNetCore.DataProtection.dll 153,080 0 100.000%
> Microsoft.AspNetCore.DataProtection.Abstractions.dll 23,544 0 100.000%
> Microsoft.AspNetCore.DataProtection.Extensions.dll 23,032 0 100.000%
> Microsoft.AspNetCore.Diagnostics.dll 240,632 12,288 94.893%
> Microsoft.AspNetCore.Diagnostics.Abstractions.dll 16,912 0 100.000%
> Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.dll 68,088 0 100.000%
> Microsoft.AspNetCore.HostFiltering.dll 21,496 7,168 66.654%
> Microsoft.AspNetCore.Hosting.dll 133,624 115,200 13.788%
> Microsoft.AspNetCore.Hosting.Abstractions.dll 23,032 11,776 48.871%
> Microsoft.AspNetCore.Hosting.Server.Abstractions.dll 15,352 6,144 59.979%
> Microsoft.AspNetCore.Html.Abstractions.dll 19,960 0 100.000%
> Microsoft.AspNetCore.Http.dll 81,912 20,480 74.998%
> Microsoft.AspNetCore.Http.Abstractions.dll 75,768 34,304 54.725%
> Microsoft.AspNetCore.Http.Connections.dll 107,000 0 100.000%
> Microsoft.AspNetCore.Http.Connections.Common.dll 25,080 0 100.000%
> Microsoft.AspNetCore.Http.Extensions.dll 38,896 0 100.000%
> Microsoft.AspNetCore.Http.Features.dll 32,248 8,704 73.009%
> Microsoft.AspNetCore.HttpOverrides.dll 30,200 6,656 77.960%
> Microsoft.AspNetCore.HttpsPolicy.dll 23,544 0 100.000%
> Microsoft.AspNetCore.Identity.dll 78,840 0 100.000%
> Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll 97,784 0 100.000%
> Microsoft.AspNetCore.Identity.UI.Views.dll 330,744 0 100.000%
> Microsoft.AspNetCore.Identity.UI.dll 2,440,184 0 100.000%
> Microsoft.AspNetCore.JsonPatch.dll 52,216 0 100.000%
> Microsoft.AspNetCore.Localization.dll 30,200 0 100.000%
> Microsoft.AspNetCore.Localization.Routing.dll 15,864 0 100.000%
> Microsoft.AspNetCore.MiddlewareAnalysis.dll 24,568 0 100.000%
> Microsoft.AspNetCore.Mvc.dll 18,936 0 100.000%
> Microsoft.AspNetCore.Mvc.Abstractions.dll 100,856 0 100.000%
> Microsoft.AspNetCore.Mvc.ApiExplorer.dll 40,952 0 100.000%
> Microsoft.AspNetCore.Mvc.Core.dll 567,312 0 100.000%
> Microsoft.AspNetCore.Mvc.Cors.dll 25,592 0 100.000%
> Microsoft.AspNetCore.Mvc.DataAnnotations.dll 47,088 0 100.000%
> Microsoft.AspNetCore.Mvc.Formatters.Json.dll 38,392 0 100.000%
> Microsoft.AspNetCore.Mvc.Formatters.Xml.dll 47,600 0 100.000%
> Microsoft.AspNetCore.Mvc.Localization.dll 32,248 0 100.000%
> Microsoft.AspNetCore.Mvc.Razor.dll 144,888 0 100.000%
> Microsoft.AspNetCore.Mvc.Razor.Extensions.dll 88,080 0 100.000%
> Microsoft.AspNetCore.Mvc.RazorPages.dll 175,120 0 100.000%
> Microsoft.AspNetCore.Mvc.TagHelpers.dll 126,456 0 100.000%
> Microsoft.AspNetCore.Mvc.ViewFeatures.dll 288,760 0 100.000%
> Microsoft.AspNetCore.NodeServices.dll 59,384 0 100.000%
> Microsoft.AspNetCore.Owin.dll 78,328 0 100.000%
> Microsoft.AspNetCore.Razor.dll 33,784 0 100.000%
> Microsoft.AspNetCore.Razor.Language.dll 469,496 0 100.000%
> Microsoft.AspNetCore.Razor.Runtime.dll 32,240 0 100.000%
> Microsoft.AspNetCore.ResponseCaching.dll 66,552 0 100.000%
> Microsoft.AspNetCore.ResponseCaching.Abstractions.dll 14,840 0 100.000%
> Microsoft.AspNetCore.ResponseCompression.dll 31,224 0 100.000%
> Microsoft.AspNetCore.Rewrite.dll 82,960 0 100.000%
> Microsoft.AspNetCore.Routing.dll 108,024 0 100.000%
> Microsoft.AspNetCore.Routing.Abstractions.dll 37,880 0 100.000%
> Microsoft.AspNetCore.Server.HttpSys.dll 186,360 0 100.000%
> Microsoft.AspNetCore.Server.IISIntegration.dll 103,416 11,264 89.108%
> Microsoft.AspNetCore.Server.Kestrel.dll 16,888 7,680 54.524%
> Microsoft.CodeAnalysis.dll 2,414,000 0 100.000%
> Microsoft.CodeAnalysis.CSharp.dll 4,681,136 0 100.000%
> Microsoft.EntityFrameworkCore.InMemory.dll 65,528 0 100.000%
> Microsoft.EntityFrameworkCore.Relational.dll 758,264 0 100.000%
> Microsoft.EntityFrameworkCore.SqlServer.dll 231,416 0 100.000%
> Microsoft.Extensions.Caching.Abstractions.dll 26,616 0 100.000%
> Microsoft.Extensions.Caching.Memory.dll 32,248 0 100.000%
> Microsoft.Extensions.Caching.SqlServer.dll 47,096 0 100.000%
> Microsoft.Extensions.Configuration.dll 25,592 14,848 41.982%
> Microsoft.Extensions.Configuration.Abstractions.dll 20,472 10,240 49.980%
> Microsoft.Extensions.Configuration.Binder.dll 25,080 14,336 42.839%
> Microsoft.Extensions.Configuration.CommandLine.dll 19,960 10,240 48.697%
> Microsoft.Extensions.Configuration.EnvironmentVariables.dll 19,960 10,240 48.697%
> Microsoft.Extensions.Configuration.FileExtensions.dll 22,008 11,264 48.819%
> Microsoft.Extensions.Configuration.Ini.dll 19,960 0 100.000%
> Microsoft.Extensions.Configuration.Json.dll 24,056 13,824 42.534%
> Microsoft.Extensions.Configuration.KeyPerFile.dll 18,424 0 100.000%
> Microsoft.Extensions.Configuration.UserSecrets.dll 19,960 10,240 48.697%
> Microsoft.Extensions.Configuration.Xml.dll 23,032 0 100.000%
> Microsoft.Extensions.DependencyInjection.dll 60,920 49,664 18.477%
> Microsoft.Extensions.DependencyInjection.Abstractions.dll 36,856 19,456 47.211%
> Microsoft.Extensions.DependencyModel.dll 62,944 0 100.000%
> Microsoft.Extensions.DiagnosticAdapter.dll 40,432 0 100.000%
> Microsoft.Extensions.FileProviders.Abstractions.dll 17,912 7,168 59.982%
> Microsoft.Extensions.FileProviders.Composite.dll 17,400 0 100.000%
> Microsoft.Extensions.FileProviders.Embedded.dll 31,736 0 100.000%
> Microsoft.Extensions.FileProviders.Physical.dll 31,736 18,944 40.308%
> Microsoft.Extensions.FileSystemGlobbing.dll 39,416 28,160 28.557%
> Microsoft.Extensions.Hosting.dll 33,272 0 100.000%
> Microsoft.Extensions.Hosting.Abstractions.dll 23,032 5,632 75.547%
> Microsoft.Extensions.Http.dll 49,648 0 100.000%
> Microsoft.Extensions.Identity.Core.dll 171,536 0 100.000%
> Microsoft.Extensions.Identity.Stores.dll 40,952 0 100.000%
> Microsoft.Extensions.Localization.dll 29,168 0 100.000%
> Microsoft.Extensions.Localization.Abstractions.dll 17,400 0 100.000%
> Microsoft.Extensions.Logging.dll 31,736 14,848 53.214%
> Microsoft.Extensions.Logging.Abstractions.dll 47,632 22,016 53.779%
> Microsoft.Extensions.Logging.Configuration.dll 18,928 7,168 62.130%
> Microsoft.Extensions.Logging.Console.dll 33,272 16,896 49.219%
> Microsoft.Extensions.Logging.Debug.dll 16,888 7,168 57.556%
> Microsoft.Extensions.Logging.EventSource.dll 26,104 0 100.000%
> Microsoft.Extensions.Logging.TraceSource.dll 19,448 0 100.000%
> Microsoft.Extensions.ObjectPool.dll 19,448 5,120 73.673%
> Microsoft.Extensions.Options.dll 40,440 9,216 77.211%
> Microsoft.Extensions.Options.ConfigurationExtensions.dll 18,448 6,144 66.696%
> Microsoft.Extensions.Primitives.dll 35,832 22,016 38.558%
> Microsoft.Extensions.WebEncoders.dll 19,952 0 100.000%
> Microsoft.IdentityModel.Logging.dll 29,296 0 100.000%
> Microsoft.IdentityModel.Protocols.dll 36,464 0 100.000%
> Microsoft.IdentityModel.Protocols.OpenIdConnect.dll 109,168 0 100.000%
> Microsoft.IdentityModel.Protocols.WsFederation.dll 49,776 0 100.000%
> Microsoft.IdentityModel.Tokens.dll 138,864 0 100.000%
> Microsoft.IdentityModel.Tokens.Saml.dll 183,920 0 100.000%
> Microsoft.IdentityModel.Xml.dll 75,888 0 100.000%
> Microsoft.Net.Http.Headers.dll 74,744 13,312 82.190%
> Newtonsoft.Json.dll 656,384 362,496 44.774%
> Newtonsoft.Json.Bson.dll 90,624 0 100.000%
> Remotion.Linq.dll 176,640 0 100.000%
> Microsoft.CSharp.dll 775,680 775,680 0.000%
> Microsoft.VisualBasic.dll 460,800 460,800 0.000%
> Microsoft.Win32.Primitives.dll 10,240 10,240 0.000%
> Microsoft.Win32.Registry.dll 51,712 23,552 54.455%
> SOS.NETCore.dll 46,080 46,080 0.000%
> System.AppContext.dll 4,608 2,560 44.444%
> System.Buffers.dll 4,608 4,608 0.000%
> System.Collections.Concurrent.dll 198,144 76,288 61.499%
> System.Collections.Immutable.dll 653,824 18,432 97.181%
> System.Collections.NonGeneric.dll 88,064 33,792 61.628%
> System.Collections.Specialized.dll 80,896 30,208 62.658%
> System.Collections.dll 326,144 326,144 0.000%
> System.Diagnostics.StackTrace.dll 23,552 13,312 43.478%
> System.Diagnostics.TextWriterTraceListener.dll 22,016 22,016 0.000%
> Microsoft.AspNetCore.Server.Kestrel.Core.dll 446,456 324,096 27.407%
> Microsoft.AspNetCore.Server.Kestrel.Https.dll 14,832 0 100.000%
> Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.dll 36,344 19,968 45.058%
> Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll 39,928 28,160 29.473%
> Microsoft.AspNetCore.Session.dll 41,464 0 100.000%
> Microsoft.AspNetCore.SignalR.dll 18,936 0 100.000%
> Microsoft.AspNetCore.SignalR.Common.dll 36,856 0 100.000%
> Microsoft.AspNetCore.SignalR.Core.dll 122,360 0 100.000%
> Microsoft.AspNetCore.SignalR.Protocols.Json.dll 33,272 0 100.000%
> Microsoft.AspNetCore.SpaServices.dll 47,608 0 100.000%
> Microsoft.AspNetCore.SpaServices.Extensions.dll 65,016 0 100.000%
> Microsoft.AspNetCore.StaticFiles.dll 70,648 0 100.000%
> Microsoft.AspNetCore.WebSockets.dll 24,056 0 100.000%
> Microsoft.AspNetCore.WebUtilities.dll 66,040 9,728 85.270%
> Microsoft.CodeAnalysis.Razor.dll 47,096 0 100.000%
> Microsoft.DotNet.PlatformAbstractions.dll 24,024 0 100.000%
> Microsoft.EntityFrameworkCore.dll 1,422,864 0 100.000%
> Microsoft.EntityFrameworkCore.Abstractions.dll 20,472 0 100.000%
> Microsoft.EntityFrameworkCore.Design.dll 235,000 0 100.000%
> System.ComponentModel.Annotations.dll 140,288 140,288 0.000%
> System.ComponentModel.DataAnnotations.dll 5,632 5,632 0.000%
> System.ComponentModel.EventBasedAsync.dll 25,088 25,088 0.000%
> System.ComponentModel.Primitives.dll 44,032 44,032 0.000%
> System.ComponentModel.TypeConverter.dll 668,160 668,160 0.000%
> System.ComponentModel.dll 6,144 6,144 0.000%
> System.Configuration.dll 8,192 8,192 0.000%
> System.Console.dll 189,440 189,440 0.000%
> System.Core.dll 11,264 11,264 0.000%
> System.Data.Common.dll 2,871,808 2,871,808 0.000%
> System.Data.dll 14,336 14,336 0.000%
> System.Diagnostics.Contracts.dll 5,120 3,072 40.000%
> System.Diagnostics.Debug.dll 4,608 4,608 0.000%
> System.Diagnostics.DiagnosticSource.dll 57,344 24,064 58.036%
> System.Diagnostics.FileVersionInfo.dll 27,648 13,312 51.852%
> System.Diagnostics.Process.dll 187,392 187,392 0.000%
> System.Diagnostics.Tools.dll 6,144 6,144 0.000%
> System.Diagnostics.TraceSource.dll 114,688 114,688 0.000%
> System.Diagnostics.Tracing.dll 26,112 26,112 0.000%
> System.Drawing.Primitives.dll 92,672 92,672 0.000%
> System.Drawing.dll 9,728 9,728 0.000%
> System.Dynamic.Runtime.dll 5,632 0 100.000%
> System.Globalization.Calendars.dll 5,120 5,120 0.000%
> System.Globalization.Extensions.dll 5,120 0 100.000%
> System.Globalization.dll 4,608 4,608 0.000%
> System.IO.Compression.Brotli.dll 58,880 58,880 0.000%
> System.IO.Compression.FileSystem.dll 4,096 4,096 0.000%
> System.IO.Compression.ZipFile.dll 24,064 24,064 0.000%
> System.IO.Compression.dll 258,560 98,816 61.782%
> System.IO.FileSystem.AccessControl.dll 18,432 18,432 0.000%
> System.IO.FileSystem.DriveInfo.dll 57,856 57,856 0.000%
> System.IO.FileSystem.Primitives.dll 4,608 3,072 33.333%
> System.IO.FileSystem.Watcher.dll 73,728 73,728 0.000%
> System.IO.FileSystem.dll 202,240 202,240 0.000%
> System.IO.IsolatedStorage.dll 68,096 68,096 0.000%
> System.IO.MemoryMappedFiles.dll 57,344 57,344 0.000%
> System.IO.Pipes.AccessControl.dll 13,312 13,312 0.000%
> System.IO.Pipes.dll 112,640 112,640 0.000%
> System.IO.UnmanagedMemoryStream.dll 4,608 4,608 0.000%
> System.IO.dll 5,120 5,120 0.000%
> System.Linq.Expressions.dll 1,620,480 506,880 68.720%
> System.Linq.Parallel.dll 1,309,184 1,309,184 0.000%
> System.Linq.Queryable.dll 167,424 56,320 66.361%
> System.Linq.dll 427,520 121,856 71.497%
> System.Memory.dll 245,760 245,760 0.000%
> System.Net.Http.dll 1,183,744 399,360 66.263%
> System.Net.HttpListener.dll 301,056 301,056 0.000%
> System.Net.Mail.dll 476,672 476,672 0.000%
> System.Net.NameResolution.dll 69,120 69,120 0.000%
> System.Net.NetworkInformation.dll 147,456 147,456 0.000%
> System.Net.Ping.dll 89,600 89,600 0.000%
> System.Net.Primitives.dll 201,216 201,216 0.000%
> System.Net.Requests.dll 337,408 337,408 0.000%
> System.Net.Security.dll 502,272 502,272 0.000%
> System.Net.ServicePoint.dll 24,064 24,064 0.000%
> System.Net.Sockets.dll 571,392 571,392 0.000%
> System.Net.WebClient.dll 151,552 151,552 0.000%
> System.Net.WebHeaderCollection.dll 56,832 56,832 0.000%
> System.Net.WebProxy.dll 16,896 16,896 0.000%
> System.Net.WebSockets.Client.dll 63,488 63,488 0.000%
> System.Net.WebSockets.dll 141,824 141,824 0.000%
> System.Net.dll 6,144 6,144 0.000%
> System.Numerics.Vectors.dll 152,064 152,064 0.000%
> System.Numerics.dll 4,096 4,096 0.000%
> System.ObjectModel.dll 76,288 31,232 59.060%
> System.Private.DataContractSerialization.dll 2,037,760 709,632 65.176%
> System.Private.Uri.dll 229,888 229,888 0.000%
> System.Private.Xml.Linq.dll 369,664 369,664 0.000%
> System.Private.Xml.dll 8,523,264 8,523,264 0.000%
> System.Reflection.DispatchProxy.dll 58,880 58,880 0.000%
> System.Reflection.Emit.ILGeneration.dll 4,608 3,072 33.333%
> System.Reflection.Emit.Lightweight.dll 4,608 2,560 44.444%
> System.Reflection.Emit.dll 4,608 3,072 33.333%
> System.Reflection.Extensions.dll 4,608 4,608 0.000%
> System.Reflection.Metadata.dll 1,069,056 147,456 86.207%
> System.Reflection.Primitives.dll 5,120 5,120 0.000%
> System.Reflection.TypeExtensions.dll 19,456 0 100.000%
> System.Reflection.dll 5,632 5,632 0.000%
> System.Resources.Reader.dll 4,608 4,608 0.000%
> System.Resources.ResourceManager.dll 4,608 4,608 0.000%
> System.Resources.Writer.dll 33,280 33,280 0.000%
> System.Runtime.CompilerServices.VisualC.dll 7,168 7,168 0.000%
> System.Runtime.Extensions.dll 385,536 385,536 0.000%
> System.Runtime.Handles.dll 4,608 4,608 0.000%
> System.Runtime.InteropServices.RuntimeInformation.dll 14,848 7,680 48.276%
> System.Runtime.InteropServices.WindowsRuntime.dll 12,800 12,800 0.000%
> System.Runtime.InteropServices.dll 36,352 36,352 0.000%
> System.Runtime.Loader.dll 4,608 4,608 0.000%
> System.Runtime.Numerics.dll 187,392 59,392 68.306%
> System.Runtime.Serialization.Formatters.dll 288,256 288,256 0.000%
> System.Runtime.Serialization.Json.dll 4,608 4,608 0.000%
> System.Runtime.Serialization.Primitives.dll 16,896 9,728 42.424%
> System.Runtime.Serialization.Xml.dll 5,632 4,096 27.273%
> System.Runtime.Serialization.dll 5,632 5,632 0.000%
> System.Runtime.dll 39,424 39,424 0.000%
> System.Security.AccessControl.dll 56,320 28,672 49.091%
> System.Security.Claims.dll 78,336 36,864 52.941%
> System.Security.Cryptography.Algorithms.dll 356,864 129,024 63.845%
> System.Security.Cryptography.Cng.dll 51,712 23,040 55.446%
> System.Security.Cryptography.Csp.dll 105,472 38,912 63.107%
> System.Security.Cryptography.Encoding.dll 62,976 28,672 54.472%
> System.Security.Cryptography.OpenSsl.dll 156,672 45,568 70.915%
> System.Security.Cryptography.Primitives.dll 80,384 33,792 57.962%
> System.Security.Cryptography.X509Certificates.dll 444,416 156,160 64.862%
> System.Security.Principal.Windows.dll 29,184 17,408 40.351%
> System.Security.Principal.dll 5,120 3,584 30.000%
> System.Security.SecureString.dll 4,608 4,608 0.000%
> System.Security.dll 6,656 6,656 0.000%
> System.ServiceModel.Web.dll 5,632 5,632 0.000%
> System.ServiceProcess.dll 4,608 4,608 0.000%
> System.Text.Encoding.Extensions.dll 4,608 4,608 0.000%
> System.Text.Encoding.dll 5,120 5,120 0.000%
> System.Text.RegularExpressions.dll 365,568 126,976 65.266%
> System.Threading.Overlapped.dll 5,632 5,632 0.000%
> System.Threading.Tasks.Dataflow.dll 478,720 478,720 0.000%
> System.Threading.Tasks.Extensions.dll 5,120 5,120 0.000%
> System.Threading.Tasks.Parallel.dll 99,328 38,912 60.825%
> System.Threading.Tasks.dll 5,632 5,632 0.000%
> System.Threading.Thread.dll 31,232 15,872 49.180%
> System.Threading.ThreadPool.dll 4,608 4,608 0.000%
> System.Threading.Timer.dll 4,608 4,608 0.000%
> System.Threading.dll 66,560 31,744 52.308%
> System.Transactions.Local.dll 341,504 341,504 0.000%
> System.Transactions.dll 5,120 5,120 0.000%
> System.ValueTuple.dll 5,120 0 100.000%
> System.Web.HttpUtility.dll 34,304 34,304 0.000%
> System.Web.dll 4,096 4,096 0.000%
> System.Windows.dll 4,608 4,608 0.000%
> System.Xml.Linq.dll 4,608 4,608 0.000%
> System.Xml.ReaderWriter.dll 11,776 8,704 26.087%
> System.Xml.Serialization.dll 5,120 5,120 0.000%
> System.Xml.XDocument.dll 5,120 3,584 30.000%
> System.Xml.XPath.XDocument.dll 6,144 3,584 41.667%
> System.Xml.XPath.dll 5,120 3,072 40.000%
> System.Xml.XmlDocument.dll 5,120 0 100.000%
> System.Xml.XmlSerializer.dll 7,168 5,120 28.571%
> System.Xml.dll 13,312 13,312 0.000%
> System.dll 43,008 43,008 0.000%
> WindowsBase.dll 4,608 4,608 0.000%
> mscorlib.dll 47,104 47,104 0.000%
> netstandard.dll 96,768 96,768 0.000%
> System.Private.CoreLib.dll 11,631,104 11,631,104 0.000%
> System.Data.SqlClient.dll 937,616 845,312 9.845%
> System.IdentityModel.Tokens.Jwt.dll 90,736 0 100.000%
> System.Interactive.Async.dll 236,320 0 100.000%
> System.IO.Pipelines.dll 48,264 29,696 38.472%
> System.Net.WebSockets.WebSocketProtocol.dll 55,952 0 100.000%
> System.Runtime.CompilerServices.Unsafe.dll 21,640 3,584 83.438%
> System.Security.Cryptography.Pkcs.dll 186,504 145,920 21.760%
> System.Security.Cryptography.Xml.dll 167,568 149,504 10.780%
> System.Security.Permissions.dll 96,400 75,264 21.925%
> System.Text.Encoding.CodePages.dll 758,928 724,992 4.472%
> System.Text.Encodings.Web.dll 61,072 24,576 59.759%
> System.Threading.Channels.dll 52,872 0 100.000%
> aspnetapp -> /app/aspnetapp/out/
> ---> 7298e56ef2eb
> Removing intermediate container 24aa20a1af00
> Step 10/13 : FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime
> ---> 7e30b6abdbd8
> Step 11/13 : WORKDIR /app
> ---> Using cache
> ---> ed512f239382
> Step 12/13 : COPY --from=build /app/aspnetapp/out ./
> ---> 5c707ffe44bc
> Step 13/13 : ENTRYPOINT dotnet aspnetapp.dll
> ---> Running in 391d5f015e6e
> ---> 84b3f4308365
> Removing intermediate container 391d5f015e6e
> Successfully built 84b3f4308365
> Successfully tagged build:ms62qfmuaS8QRDmvuPmNGngg_1535512538
> ▲ Assembling image
> ▲ The built image size (107.1M) exceeds the 100MiB limit
> Error! Build failed
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ micro .
Cannot read . because it is a directory
Press enter to continue
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ micro Dockerfile
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ now
> Deploying ~/Code/github/now-examples/dotnetcore under solrevdev
> Synced 1 file (511B) [2s]
> https://dotnetcore-ckyzprerbu.now.sh [in clipboard] (bru1) [4s]
> Building…
> Sending build context to Docker daemon 12.8kB
> Step 1/13 : FROM microsoft/dotnet:2.1-sdk-alpine AS build
> ---> 11a4b528481d
> Step 2/13 : WORKDIR /app
> ---> 96aae55687c0
> Removing intermediate container afff1b339db5
> Step 3/13 : COPY *.sln .
> ---> 4ae244ffb2a1
> Step 4/13 : COPY aspnetapp/*.csproj ./aspnetapp/
> ---> 9e3140f441e9
> Step 5/13 : COPY aspnetapp/nuget.config ./aspnetapp/
> ---> acc9b1ec3187
> Step 6/13 : RUN dotnet restore
> ---> Running in e17d3a80f307
> Restoring packages for /app/aspnetapp/aspnetapp.csproj...
> Installing ILLink.Tasks 0.1.4-preview-906439.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.props.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.targets.
> Restore completed in 7.75 sec for /app/aspnetapp/aspnetapp.csproj.
> ---> 53b9be430c7d
> Removing intermediate container e17d3a80f307
> Step 7/13 : COPY aspnetapp/. ./aspnetapp/
> ---> bd42f458963c
> Step 8/13 : WORKDIR /app/aspnetapp
> ---> a3fea9a9d2b6
> Removing intermediate container 141b1975c0f2
> Step 9/13 : RUN dotnet publish -c Release -o out -r linux-x64
> ---> Running in 1c015fbce02d
> Microsoft (R) Build Engine version 15.7.179.6572 for .NET Core
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> Restoring packages for /app/aspnetapp/aspnetapp.csproj...
> Retrying 'FindPackagesByIdAsync' for source 'https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/microsoft.aspnetcore.signalr/index.json'.
> The HTTP request to 'GET https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/microsoft.aspnetcore.signalr/index.json' has timed out after 100000ms.
> Installing Microsoft.NETCore.DotNetAppHost 2.1.2.
> Installing Microsoft.NETCore.DotNetHostResolver 2.1.2.
> Installing Microsoft.AspNetCore.SignalR 1.0.2.
> Installing Microsoft.AspNetCore.Identity.UI 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Core 2.1.2.
> Installing Microsoft.Extensions.Identity.Core 2.1.2.
> Installing Microsoft.AspNetCore.SignalR.Core 1.0.2.
> Installing Microsoft.AspNetCore.Http.Connections 1.0.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets 2.1.2.
> Installing Microsoft.AspNetCore.SignalR.Common 1.0.2.
> Installing Microsoft.AspNetCore.Identity 2.1.2.
> Installing Microsoft.AspNetCore.Identity.EntityFrameworkCore 2.1.2.
> Installing Microsoft.Extensions.Identity.Stores 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel.Https 2.1.2.
> Installing Microsoft.AspNetCore.Server.Kestrel 2.1.2.
> Installing Microsoft.AspNetCore.SignalR.Protocols.Json 1.0.2.
> Installing Microsoft.AspNetCore.Connections.Abstractions 2.1.2.
> Installing Microsoft.AspNetCore.Http.Connections.Common 1.0.2.
> Installing Microsoft.AspNetCore 2.1.2.
> Installing Microsoft.NETCore.DotNetHostPolicy 2.1.2.
> Installing Microsoft.NETCore.Targets 2.0.0.
> Installing Microsoft.AspNetCore.App 2.1.2.
> Installing Microsoft.NETCore.App 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetAppHost 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy 2.1.2.
> Installing runtime.linux-x64.Microsoft.NETCore.App 2.1.2.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.props.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.targets.
> Restore completed in 1.81 min for /app/aspnetapp/aspnetapp.csproj.
> aspnetapp -> /app/aspnetapp/out/
> ---> 470b508f1a91
> Removing intermediate container 1c015fbce02d
> Step 10/13 : FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime
> 2.1-aspnetcore-runtime-alpine: Pulling from microsoft/dotnet
> 911c6d0c7995: Already exists
> b0c5bf29a556: Pulling fs layer
> 5df127ad1c65: Pulling fs layer
> b0c5bf29a556: Verifying Checksum
> b0c5bf29a556: Download complete
> b0c5bf29a556: Pull complete
> 5df127ad1c65: Download complete
> 5df127ad1c65: Pull complete
> Digest: sha256:b06c6e628156b35be90d555d33e27fa9e07afc4b8e777fc3c48f15804410b3a6
> Status: Downloaded newer image for microsoft/dotnet:2.1-aspnetcore-runtime-alpine
> ---> b4328ca4bdf2
> Step 11/13 : WORKDIR /app
> ---> 33682bd17d8a
> Removing intermediate container 2b1b83bbe5fb
> Step 12/13 : COPY --from=build /app/aspnetapp/out ./
> ---> 03d60059e601
> Step 13/13 : ENTRYPOINT dotnet aspnetapp.dll
> ---> Running in 07f26e6d6c6b
> ---> 150bfef812fe
> Removing intermediate container 07f26e6d6c6b
> Successfully built 150bfef812fe
> Successfully tagged build:vCPuKx3MGIg6FSaQYrbJ9O6T_1535512707
> ▲ Assembling image
> ▲ The built image size (107.1M) exceeds the 100MiB limit
> Error! Build failed
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git reset
Unstaged changes after reset:
M dotnetcore/Dockerfile
M dotnetcore/aspnetapp/aspnetapp.csproj
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git status
On branch solrevdev/dotnetcore-linker
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Dockerfile
modified: aspnetapp/aspnetapp.csproj
Untracked files:
(use "git add <file>..." to include in what will be committed)
aspnetapp/nuget.config
no changes added to commit (use "git add" and/or "git commit -a")
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git reset Dockerfile
Unstaged changes after reset:
M dotnetcore/Dockerfile
M dotnetcore/aspnetapp/aspnetapp.csproj
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git reset HEAD Dockerfile
Unstaged changes after reset:
M dotnetcore/Dockerfile
M dotnetcore/aspnetapp/aspnetapp.csproj
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git checkout Dockerfile
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git checkout aspnetapp/aspnetapp.csproj
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ git status
On branch solrevdev/dotnetcore-linker
Untracked files:
(use "git add <file>..." to include in what will be committed)
aspnetapp/nuget.config
nothing added to commit but untracked files present (use "git add" to track)
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ rm -rf aspnetapp/nuget.config
solrevdev@haplaptop:~/Code/github/now-examples/dotnetcore$ now
> Deploying ~/Code/github/now-examples/dotnetcore under solrevdev
> https://dotnetcore-anetpspxwx.now.sh [in clipboard] (bru1) [4s]
> Building…
> ---> 112ea9d22f0e
> Step 2/12 : WORKDIR /app
> ---> Using cache
> Sending build context to Docker daemon 11.78kB
> Step 1/12 : FROM microsoft/dotnet:2.1-sdk-alpine AS build
> ---> 6e83d10a10ce
> Step 3/12 : COPY *.sln .
> ---> Using cache
> ---> b70c47e03c14
> Step 4/12 : COPY aspnetapp/*.csproj ./aspnetapp/
> ---> 04cd8852f328
> Step 5/12 : RUN dotnet restore
> ---> Running in becc41df43a0
> Restoring packages for /app/aspnetapp/aspnetapp.csproj...
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.props.
> Generating MSBuild file /app/aspnetapp/obj/aspnetapp.csproj.nuget.g.targets.
> Restore completed in 910.95 ms for /app/aspnetapp/aspnetapp.csproj.
> ---> 89e4396294d1
> Removing intermediate container becc41df43a0
> Step 6/12 : COPY aspnetapp/. ./aspnetapp/
> ---> 8d5df1a5b22c
> Step 7/12 : WORKDIR /app/aspnetapp
> Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> ---> deaad00b92b8
> Removing intermediate container 791b8bdaa2b0
> Step 8/12 : RUN dotnet publish -c Release -o out
> ---> Running in 6935d207b02e
> Restore completed in 53.9 ms for /app/aspnetapp/aspnetapp.csproj.
> aspnetapp -> /app/aspnetapp/bin/Release/netcoreapp2.1/aspnetapp.dll
> aspnetapp -> /app/aspnetapp/out/
> ---> c4d32e07a11e
> Removing intermediate container 6935d207b02e
> Step 9/12 : FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine AS runtime
> ---> b4328ca4bdf2
> Step 10/12 : WORKDIR /app
> ---> Using cache
> ---> 517059af1258
> Step 11/12 : COPY --from=build /app/aspnetapp/out ./
> ---> 52c72ef27183
> Step 12/12 : ENTRYPOINT dotnet aspnetapp.dll
> ---> Running in 7d5a84fe70d8
> ---> 403f99798339
> Removing intermediate container 7d5a84fe70d8
> Successfully built 403f99798339
> Successfully tagged build:QETU6UjeRAfQbY13AHuBE9AP_1535513173
> ▲ Assembling image
> ▲ Storing image (76.0M)
> Build completed
> Verifying instantiation in bru1
> [0] Hosting environment: Production
> [0] Content root path: /app
> [0] Now listening on: http://[::]:80
> [0] Application started. Press Ctrl+C to shut down.
> ✔ Scaled 1 instance in bru1 [8s]
> Success! Deployment ready
@solrevdev
Copy link
Author

solrevdev commented Aug 29, 2018

The final success is me resetting the existing dockerfile and the sample still worked btw.

Perhaps it’s the Linux build that’s adding the weight or the special myget build?

@solrevdev
Copy link
Author

solrevdev commented Aug 29, 2018

There is a newer version of the linker I copied and pasted ‘0.1.4-preview-906439’ where 0.1.5-preview is available but not sure that would reduce sizes.

Not sure... it’s 5am here so will pick up again tomorrow night

@shanselman
Copy link

Try this as I thikn you're doing BOTH a self-contained build AND using the runtime image. You have two copies of ASP.NET and .NET Core. If you're doing self contained, try this - just the dependencies.

FROM microsoft/dotnet:2.1-runtime-deps-alpine AS runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment