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

Commit 40165a4

Browse files
Merge pull request #16 from thefringeninja/much-smaller
Produce Self Contained App in Container
2 parents 88b2c04 + 9709433 commit 40165a4

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM microsoft/dotnet:2.1.401-sdk-alpine3.7 AS build
1+
FROM microsoft/dotnet:2.1.402-sdk-alpine3.7 AS build
22
ARG TRAVIS_BUILD_NUMBER
33
ARG MYGET_API_KEY
44
WORKDIR /src
@@ -9,7 +9,7 @@ RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.
99

1010
COPY ./NuGet.Config ./
1111

12-
RUN dotnet restore
12+
RUN dotnet restore --runtime=alpine.3.7-x64
1313

1414
COPY ./src .
1515

@@ -27,11 +27,11 @@ RUN TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER MYGET_API_KEY=$MYGET_API_KEY dotnet
2727

2828
WORKDIR /src/SqlStreamStore.HAL.DevServer
2929

30-
RUN dotnet publish --configuration=Release --output=/publish --no-build --no-restore
30+
RUN dotnet publish --configuration=Release --output=/publish --no-restore --runtime=alpine.3.7-x64
3131

32-
FROM microsoft/dotnet:2.1.3-aspnetcore-runtime-alpine3.7 AS runtime
32+
FROM microsoft/dotnet:2.1.4-runtime-deps-alpine3.7 AS runtime
3333

3434
WORKDIR /app
3535
COPY --from=build /publish ./
3636

37-
ENTRYPOINT ["dotnet", "SqlStreamStore.HAL.DevServer.dll"]
37+
ENTRYPOINT ["/app/SqlStreamStore.HAL.DevServer"]

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<OutputType>Exe</OutputType>
44
<TargetFramework>netcoreapp2.1</TargetFramework>
55
<LangVersion>latest</LangVersion>
6+
<RuntimeIdentifiers>alpine.3.7-x64</RuntimeIdentifiers>
7+
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
68
</PropertyGroup>
79
<ItemGroup>
810
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />

0 commit comments

Comments
 (0)