This commit is contained in:
Sander Saares 2020-01-28 15:43:44 +02:00
commit afe4246b5a
2 changed files with 5 additions and 4 deletions

View file

@ -5,6 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>docker_exporter</AssemblyName> <AssemblyName>docker_exporter</AssemblyName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PublishTrimmed>true</PublishTrimmed>
<LangVersion>preview</LangVersion> <LangVersion>preview</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View file

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
WORKDIR /app WORKDIR /app
# Separate layers here to avoid redoing dependencies on code change. # Separate layers here to avoid redoing dependencies on code change.
@ -8,10 +8,10 @@ RUN dotnet restore
# Now the code. # Now the code.
COPY . . COPY . .
RUN dotnet publish -c Release -o out RUN dotnet publish -r linux-musl-x64 -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-alpine AS runtime
WORKDIR /app WORKDIR /app
COPY --from=build /app/out . COPY --from=build /app/out .
ENTRYPOINT ["dotnet", "docker_exporter.dll"] ENTRYPOINT ["./docker_exporter"]