IT漫步

技术生活札记©Yaohui

Add File Extension to Windows IIS Container during image build

Let’s say: we need to add json file extension to the containerized IIS. Dockerfile: FROM {imageRegistry}/mcr.microsoft.com/dotnet/framework/aspnet:4.8-20200114-windowsservercore-ltsc2019 COPY . /inetpub/wwwroot WORKDIR /inetpub/wwwroot RUN C:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site" -section:system.webServer/security/requestFiltering /+"fileExtensions.[fileExtension='json',allowed='True']" ENV ASPNETCORE_URLS http://+:80 EXPOSE 80/tcp An error occurs during build docker image: Step 1/6 : FROM repo.q1lan.k8s:9999/mcr.microsoft.com/dotnet/framework/aspnet:4.8-20200114-windowsservercore-ltsc2019 ---> a5bc996f06b3 Step 2/6 : COPY . /inetpub/wwwroot …

Proudly powered by WordPress