diff --git a/Dockerfile b/Dockerfile index 24d5fbc4e..37d10c879 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/aspnetcore-build:2.0.5-2.1.4 AS build-env +FROM microsoft/dotnet:2.1-sdk AS build-env WORKDIR /app @@ -11,7 +11,7 @@ COPY ./src ./ RUN dotnet publish -c Release -o ./obj/Docker/publish # Build runtime image -FROM microsoft/aspnetcore:2.0.8 as release +FROM microsoft/dotnet:2.1-aspnetcore-runtime as release RUN groupadd -r dotnet && useradd --no-log-init -r -g dotnet -d /home/dotnet -ms /bin/bash dotnet USER dotnet WORKDIR /home/dotnet/app diff --git a/src/Hamuste.csproj b/src/Hamuste.csproj index 3f2430c09..5508acdac 100644 --- a/src/Hamuste.csproj +++ b/src/Hamuste.csproj @@ -1,6 +1,6 @@  - netcoreapp2.0 + netcoreapp2.1 @@ -13,7 +13,7 @@ - + diff --git a/src/Startup.cs b/src/Startup.cs index a608b9b60..a763bfc46 100644 --- a/src/Startup.cs +++ b/src/Startup.cs @@ -11,8 +11,6 @@ using Microsoft.IdentityModel.Clients.ActiveDirectory; using Serilog; using System.Linq; -using System.Net.Http; -using System.Threading; using Microsoft.AspNetCore.Http; namespace Hamuste @@ -45,7 +43,7 @@ public Startup(IHostingEnvironment env) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices (IServiceCollection services) { - services.AddMvc (options => options.AddMetricsResourceFilter ()); + services.AddMvc().AddMetrics(); services.AddSwaggerGen (swagger => { swagger.SwaggerDoc ("v1", new Swashbuckle.AspNetCore.Swagger.Info { Title = "Hamuste Swagger" }); @@ -67,7 +65,7 @@ public void ConfigureServices (IServiceCollection services) { return new KeyVaultClient(GetToken); }); - services.AddScheme("kubernetes", null); + services.AddAuthentication().AddScheme("kubernetes", null); services.AddAuthorization(options => { options.AddPolicy("KubernetesPolicy", policyBuilder => policyBuilder.RequireAssertion(