You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Dockerfiles generated by VS include the following line:
RUN dotnet publish "WebApplication.csproj" -c Release -o /app/publish
This ends up outputting both a WebApplication executable and a WebApplication.dll library file in the output directory. Either file can be used to execute the app. The executable can be executed directly while the DLL requires the use of the .NET CLI (dotnet WebApplication.dll). From an image size perspective, it seems wasteful to include both files in the output. Only one of them is actually needed in order to execute the app. The Dockerfile is configured to only make use of the DLL:
ENTRYPOINT ["dotnet", "WebApplication31.dll"]
So it seems reasonable to simply not include the executable in the output.
By using the UseAppHost property, the publish logic can be configured to not include the executable in the output.
I propose that the Dockerfiles generated by the tools set this property by default:
RUN dotnet publish "WebApplication.csproj" -c Release -o /app/publish /p:UseAppHost=false
The text was updated successfully, but these errors were encountered:
From @mthalman originally in microsoft/DockerTools#321
The Dockerfiles generated by VS include the following line:
This ends up outputting both a
WebApplication
executable and aWebApplication.dll
library file in the output directory. Either file can be used to execute the app. The executable can be executed directly while the DLL requires the use of the .NET CLI (dotnet WebApplication.dll
). From an image size perspective, it seems wasteful to include both files in the output. Only one of them is actually needed in order to execute the app. The Dockerfile is configured to only make use of the DLL:So it seems reasonable to simply not include the executable in the output.
By using the
UseAppHost
property, the publish logic can be configured to not include the executable in the output.I propose that the Dockerfiles generated by the tools set this property by default:
The text was updated successfully, but these errors were encountered: