Skip to content

Commit

Permalink
upgrade to dotnet 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlh committed Jul 24, 2018
1 parent 4584f5b commit a3b674c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Hamuste.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
Expand All @@ -13,7 +13,7 @@
<PackageReference Include="App.Metrics.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="App.Metrics.Formatters.Prometheus" Version="2.0.0" />
<PackageReference Include="KubernetesClient" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="2.3.2" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.0.0" />
Expand Down
6 changes: 2 additions & 4 deletions src/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" });
Expand All @@ -67,7 +65,7 @@ public void ConfigureServices (IServiceCollection services) {
return new KeyVaultClient(GetToken);
});

services.AddScheme<KubernetesAuthenticationOptions, KubernetesAuthenticationHandler>("kubernetes", null);
services.AddAuthentication().AddScheme<KubernetesAuthenticationOptions, KubernetesAuthenticationHandler>("kubernetes", null);

services.AddAuthorization(options => {
options.AddPolicy("KubernetesPolicy", policyBuilder => policyBuilder.RequireAssertion(
Expand Down

0 comments on commit a3b674c

Please sign in to comment.