diff --git a/host/4/dotnet-build.yml b/host/4/dotnet-build.yml index 21a1be1e4..10bbef87e 100644 --- a/host/4/dotnet-build.yml +++ b/host/4/dotnet-build.yml @@ -77,7 +77,7 @@ jobs: dockerImagePath: "dotnet-isolated" dockerImageName: "-dotnet-isolated7.0-appservice" _isolated-net-7-mariner: - dotnetVersion: "dotnet7-isolated" + dotnetVersion: "dotnet7-isolated-mariner" dockerfilePath: "host/4/mariner/dotnet/dotnet-isolated/" dockerImagePath: "dotnet-isolated" dockerImageName: "-dotnet-isolated7.0-mariner" @@ -96,6 +96,11 @@ jobs: dockerfilePath: "host/4/bullseye/amd64/out/dotnet/" dockerImagePath: "dotnet-isolated" dockerImageName: "-dotnet-isolated8.0-appservice" + _isolated-net-8-mariner: + dotnetVersion: "dotnet8-isolated-mariner" + dockerfilePath: "host/4/mariner/dotnet/dotnet-isolated/" + dockerImagePath: "dotnet-isolated" + dockerImageName: "-dotnet-isolated8.0-mariner" _bookwork-net-6: dotnetVersion: "dotnet6" dockerfilePath: "host/4/bookworm/dotnet/" @@ -145,4 +150,4 @@ jobs: displayName: 'Publish SBOM Artifact' inputs: targetPath: host/_manifest - artifact: SBOM-Functionsv4-dotnet-$(Build.SourceBranchName) \ No newline at end of file + artifact: SBOM-Functionsv4-dotnet-$(Build.SourceBranchName) diff --git a/host/4/mariner/dotnet/dotnet-isolated/dotnet7-isolated.Dockerfile b/host/4/mariner/dotnet/dotnet-isolated/dotnet7-isolated-mariner.Dockerfile similarity index 100% rename from host/4/mariner/dotnet/dotnet-isolated/dotnet7-isolated.Dockerfile rename to host/4/mariner/dotnet/dotnet-isolated/dotnet7-isolated-mariner.Dockerfile diff --git a/host/4/mariner/dotnet/dotnet-isolated/dotnet8-isolated-mariner.Dockerfile b/host/4/mariner/dotnet/dotnet-isolated/dotnet8-isolated-mariner.Dockerfile new file mode 100644 index 000000000..d808701e1 --- /dev/null +++ b/host/4/mariner/dotnet/dotnet-isolated/dotnet8-isolated-mariner.Dockerfile @@ -0,0 +1,39 @@ +# Build the runtime from source +ARG HOST_VERSION=4.29.1 +FROM mcr.microsoft.com/dotnet/sdk:6.0-cbl-mariner2.0 AS sdk-image +ARG HOST_VERSION + +ENV PublishWithAspNetCoreTargetManifest=false + +RUN BUILD_NUMBER=$(echo ${HOST_VERSION} | cut -d'.' -f 3) && \ + git clone --branch v${HOST_VERSION} https://github.com/Azure/azure-functions-host /src/azure-functions-host && \ + cd /src/azure-functions-host && \ + HOST_COMMIT=$(git rev-list -1 HEAD) && \ + dotnet publish -v q /p:BuildNumber=$BUILD_NUMBER /p:CommitHash=$HOST_COMMIT src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj -c Release --output /azure-functions-host --runtime linux-x64 --self-contained && \ + mv /azure-functions-host/workers /workers && mkdir /azure-functions-host/workers && \ + rm -rf /root/.local /root/.nuget /src + +# Include ASP.NET Core shared framework from dotnet/aspnet image. +FROM mcr.microsoft.com/dotnet/aspnet:8.0-cbl-mariner2.0 AS aspnet8 + +FROM mcr.microsoft.com/dotnet/runtime:8.0-cbl-mariner2.0 +ARG HOST_VERSION + +RUN yum install -y dnf + +ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ + HOME=/home \ + FUNCTIONS_WORKER_RUNTIME=dotnet-isolated \ + DOTNET_USE_POLLING_FILE_WATCHER=true \ + HOST_VERSION=${HOST_VERSION} \ + ASPNETCORE_CONTENTROOT=/azure-functions-host \ + AzureWebJobsFeatureFlags=EnableWorkerIndexing \ + ASPNETCORE_URLS=http://+:80 + +# Fix from https://github.com/GoogleCloudPlatform/google-cloud-dotnet-powerpack/issues/22#issuecomment-729895157 +RUN dnf install -y glibc-devel + +COPY --from=sdk-image [ "/azure-functions-host", "/azure-functions-host" ] +COPY --from=aspnet8 [ "/usr/share/dotnet", "/usr/share/dotnet" ] + +CMD [ "/azure-functions-host/Microsoft.Azure.WebJobs.Script.WebHost" ] \ No newline at end of file diff --git a/host/4/publish.yml b/host/4/publish.yml index 485a7bbf9..5f9a004f6 100644 --- a/host/4/publish.yml +++ b/host/4/publish.yml @@ -159,6 +159,18 @@ steps: displayName: tag and push dotnet8-isolated images continueOnError: false + - bash: | + set -e + docker pull $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-mariner + + docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-mariner $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-mariner + + docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-mariner + + docker system prune -a -f + displayName: tag and push dotnet8-isolated mariner images + continueOnError: false + - bash: | set -e docker pull $SOURCE_REGISTRY/java:$(PrivateVersion)-java8 diff --git a/host/4/republish.yml b/host/4/republish.yml index bcfac6277..44545b9cd 100644 --- a/host/4/republish.yml +++ b/host/4/republish.yml @@ -135,6 +135,18 @@ steps: displayName: tag and push dotnet8-isolated images continueOnError: false + - bash: | + set -e + docker pull $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-mariner + + docker tag $SOURCE_REGISTRY/dotnet-isolated:$(PrivateVersion)-dotnet-isolated8.0-mariner $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-mariner + + docker push $TARGET_REGISTRY/dotnet-isolated:$(TargetVersion)-dotnet-isolated8.0-mariner + + docker system prune -a -f + displayName: tag and push dotnet8-isolated mariner images + continueOnError: false + - bash: | set -e docker pull $SOURCE_REGISTRY/java:$(PrivateVersion)-java8