Updating Samples for .net 5.0 (#2315)
This commit is contained in:
Родитель
2495bebd5a
Коммит
244804c9b8
|
@ -98,12 +98,6 @@ Tag | Dockerfile
|
|||
dotnetapp-nanoserver-1909, dotnetapp, latest | [Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile)
|
||||
aspnetapp-nanoserver-1909, aspnetapp | [Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile)
|
||||
|
||||
## Windows Server, version 1903 amd64 Tags
|
||||
Tag | Dockerfile
|
||||
---------| ---------------
|
||||
dotnetapp-nanoserver-1903, dotnetapp, latest | [Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/samples/dotnetapp/Dockerfile)
|
||||
aspnetapp-nanoserver-1903, aspnetapp | [Dockerfile](https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile)
|
||||
|
||||
## Windows Server 2019 amd64 Tags
|
||||
Tag | Dockerfile
|
||||
---------| ---------------
|
||||
|
|
|
@ -11,7 +11,5 @@ $(McrTagsYmlTagGroup:dotnetapp-nanoserver-2004)
|
|||
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-2004)
|
||||
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-1909)
|
||||
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-1909)
|
||||
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-1903)
|
||||
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-1903)
|
||||
$(McrTagsYmlTagGroup:dotnetapp-nanoserver-1809)
|
||||
$(McrTagsYmlTagGroup:aspnetapp-nanoserver-1809)
|
||||
|
|
|
@ -50,14 +50,6 @@
|
|||
"dotnetapp-nanoserver-1809": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"dockerfile": "samples/dotnetapp",
|
||||
"os": "windows",
|
||||
"osVersion": "nanoserver-1903",
|
||||
"tags": {
|
||||
"dotnetapp-nanoserver-1903": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"dockerfile": "samples/dotnetapp",
|
||||
"os": "windows",
|
||||
|
@ -161,23 +153,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dockerfile": "samples/aspnetapp",
|
||||
"os": "windows",
|
||||
"osVersion": "nanoserver-1903",
|
||||
"tags": {
|
||||
"aspnetapp-nanoserver-1903": {}
|
||||
},
|
||||
"customBuildLegGroups": [
|
||||
{
|
||||
"name": "pr-build",
|
||||
"type": "Integral",
|
||||
"dependencies": [
|
||||
"$(Repo:samples):dotnetapp-nanoserver-1903"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dockerfile": "samples/aspnetapp",
|
||||
"os": "windows",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-arm64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine-arm64v8
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine-arm64v8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-alpine
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-alpine-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-arm --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm32v7
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim-arm32v7
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["./aspnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-arm64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-arm64v8
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim-arm64v8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["./aspnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["./aspnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-buster-slim-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["./aspnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,8 +13,8 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r win-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
# Uses the 2009 release; 2004, 1909, 1903, and 1809 are other choices
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-2009 AS runtime
|
||||
# Uses the 2009 release; 2004, 1909, and 1809 are other choices
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-nanoserver-2009 AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["aspnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r win-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
# Uses the 2009 release; 2004, 1909, 1903, and 1809 are other choices
|
||||
# Uses the 2009 release; 2004, 1909, and 1809 are other choices
|
||||
FROM mcr.microsoft.com/windows/nanoserver:2009 AS runtime
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -13,7 +13,7 @@ WORKDIR /source/aspnetapp
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["./aspnetapp"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<UserSecretsId>57393389627611478466</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -26,7 +26,7 @@ FROM build AS publish
|
|||
RUN dotnet publish -c release --no-build -o /app
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENTRYPOINT ["dotnet", "complexapp.dll"]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["dotnet", "dotnetapp.dll"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-arm64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-alpine-arm64v8
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine-arm64v8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-alpine
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-alpine-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-musl-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-alpine
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-alpine-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-arm --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm32v7
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim-arm32v7
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-arm64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim-arm64v8
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim-arm64v8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-buster-slim-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,8 +11,8 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r win-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
# Uses the 2009 release; Other choices: 2004, 1909, 1903, 1809
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-2009
|
||||
# Uses the 2009 release; Other choices: 2004, 1909, 1809
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-nanoserver-2009
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r win-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
# Uses the 2009 release; Other choices: 2004, 1909, 1903, 1809
|
||||
# Uses the 2009 release; Other choices: 2004, 1909, 1809
|
||||
FROM mcr.microsoft.com/windows/nanoserver:2009
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-arm --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-bionic-arm32v7
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-focal-arm32v7
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-arm64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-bionic-arm64v8
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-focal-arm64v8
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-bionic
|
||||
FROM mcr.microsoft.com/dotnet/runtime:5.0-focal-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
||||
# https://hub.docker.com/_/microsoft-dotnet
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
|
@ -11,7 +11,7 @@ COPY . .
|
|||
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained true --no-restore /p:PublishTrimmed=true /p:PublishReadyToRun=true
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/core/runtime-deps:3.1-bionic
|
||||
FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-focal-amd64
|
||||
WORKDIR /app
|
||||
COPY --from=build /app .
|
||||
ENTRYPOINT ["./dotnetapp"]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -6,6 +6,7 @@ using System;
|
|||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Runtime;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace Microsoft.DotNet.Docker.Tests
|
||||
|
@ -150,8 +151,15 @@ namespace Microsoft.DotNet.Docker.Tests
|
|||
private static string GetDockerOS() => Execute("version -f \"{{ .Server.Os }}\"");
|
||||
private static string GetDockerArch() => Execute("version -f \"{{ .Server.Arch }}\"");
|
||||
|
||||
public string GetContainerAddress(string container) =>
|
||||
ExecuteWithLogging("inspect -f \"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}\" " + container);
|
||||
public string GetContainerAddress(string container)
|
||||
{
|
||||
string containerAddress = ExecuteWithLogging("inspect -f \"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}\" " + container);
|
||||
if (String.IsNullOrWhiteSpace(containerAddress)){
|
||||
containerAddress = ExecuteWithLogging("inspect -f \"{{.NetworkSettings.Networks.nat.IPAddress }}\" " + container);
|
||||
}
|
||||
|
||||
return containerAddress;
|
||||
}
|
||||
|
||||
public string GetContainerHostPort(string container, int containerPort = 80) =>
|
||||
ExecuteWithLogging(
|
||||
|
|
|
@ -54,7 +54,6 @@ namespace Microsoft.DotNet.Docker.Tests
|
|||
new ProductImageData { Version = V3_1, OS = OS.NanoServer2004, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V3_1, OS = OS.NanoServer2009, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V5_0, OS = OS.NanoServer1809, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V5_0, OS = OS.NanoServer1903, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V5_0, OS = OS.NanoServer1909, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V5_0, OS = OS.NanoServer2004, Arch = Arch.Amd64 },
|
||||
new ProductImageData { Version = V5_0, OS = OS.NanoServer2009, Arch = Arch.Amd64 },
|
||||
|
@ -83,7 +82,6 @@ namespace Microsoft.DotNet.Docker.Tests
|
|||
private static readonly SampleImageData[] s_windowsSampleTestData =
|
||||
{
|
||||
new SampleImageData { OS = OS.NanoServer1809, Arch = Arch.Amd64, IsPublished = true },
|
||||
new SampleImageData { OS = OS.NanoServer1903, Arch = Arch.Amd64, IsPublished = true },
|
||||
new SampleImageData { OS = OS.NanoServer1909, Arch = Arch.Amd64, IsPublished = true },
|
||||
new SampleImageData { OS = OS.NanoServer2004, Arch = Arch.Amd64, IsPublished = true },
|
||||
new SampleImageData { OS = OS.NanoServer2009, Arch = Arch.Amd64, IsPublished = true },
|
||||
|
|
|
@ -56,7 +56,8 @@ $activeOS = docker version -f "{{ .Server.Os }}"
|
|||
|
||||
if (!(Test-Path $DotnetInstallScript)) {
|
||||
$DOTNET_INSTALL_SCRIPT_URL = "https://dot.net/v1/$DotnetInstallScript"
|
||||
Invoke-WebRequest $DOTNET_INSTALL_SCRIPT_URL -OutFile $DotnetInstallDir/$DotnetInstallScript
|
||||
$EngCommonDir = "$PSScriptRoot/../eng/common"
|
||||
& $EngCommonDir/Invoke-WithRetry.ps1 "Invoke-WebRequest $DOTNET_INSTALL_SCRIPT_URL -OutFile $DotnetInstallDir/$DotnetInstallScript"
|
||||
}
|
||||
|
||||
if ($IsRunningOnUnix) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче