Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 49c4412

Browse files
Merge pull request #19 from thefringeninja/even-smallier
Use Linker to Shrink Container Even Further
2 parents a4605d3 + 8473ec3 commit 49c4412

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ WORKDIR /
2525

2626
RUN TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER MYGET_API_KEY=$MYGET_API_KEY dotnet run --project build/build.csproj
2727

28+
FROM build as publish
29+
2830
WORKDIR /src/SqlStreamStore.HAL.DevServer
2931

30-
RUN dotnet publish --configuration=Release --output=/publish --no-restore --runtime=alpine.3.7-x64
32+
RUN dotnet add package ILLink.Tasks --version=0.1.5-preview-1841731 --source=https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
33+
RUN dotnet publish --configuration=Release --output=/publish --runtime=alpine.3.7-x64 /p:ShowLinkerSizeComparison=true
3134

3235
FROM microsoft/dotnet:2.1.4-runtime-deps-alpine3.7 AS runtime
3336

3437
WORKDIR /app
35-
COPY --from=build /publish ./
38+
COPY --from=publish /publish ./
3639

3740
ENTRYPOINT ["/app/SqlStreamStore.HAL.DevServer"]

src/SqlStreamStore.HAL.DevServer/SqlStreamStore.HAL.DevServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<RuntimeIdentifiers>alpine.3.7-x64</RuntimeIdentifiers>
66
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
77
<LangVersion>latest</LangVersion>
8+
<CrossGenDuringPublish>false</CrossGenDuringPublish>
89
</PropertyGroup>
910
<ItemGroup>
1011
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />

src/SqlStreamStore.HAL/SqlStreamStore.HAL.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<DebugSymbols>true</DebugSymbols>
88
<NoWarn>1701;1702;1705;1591</NoWarn>
99
<LangVersion>latest</LangVersion>
10+
<CrossGenDuringPublish>false</CrossGenDuringPublish>
1011
</PropertyGroup>
1112
<ItemGroup>
1213
<PackageReference Include="Halcyon" Version="2.5.1" />
@@ -18,4 +19,4 @@
1819
<ItemGroup>
1920
<EmbeddedResource Include="Resources\Schema\*.json" />
2021
</ItemGroup>
21-
</Project>
22+
</Project>

0 commit comments

Comments
 (0)