diff --git a/DockerExporter.csproj b/DockerExporter.csproj index 17b145b..68646c7 100644 --- a/DockerExporter.csproj +++ b/DockerExporter.csproj @@ -5,6 +5,7 @@ netcoreapp3.1 docker_exporter false + true preview enable diff --git a/Dockerfile b/Dockerfile index 556ec4d..b3a9b3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 # Separate layers here to avoid redoing dependencies on code change. @@ -8,10 +8,10 @@ RUN dotnet restore # Now the code. 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 COPY --from=build /app/out . -ENTRYPOINT ["dotnet", "docker_exporter.dll"] \ No newline at end of file +ENTRYPOINT ["./docker_exporter"]