From 12c1d074342572f1eed231b9e7c86773ea85bf59 Mon Sep 17 00:00:00 2001 From: "stam@epicm.org" Date: Mon, 25 Apr 2022 02:47:59 +0300 Subject: [PATCH] win32 update --- .../base/microsoft-windows-10/README.md | 4 - .../microsoft-windows-servercore/Dockerfile | 92 ++++++++++++++----- .../docker-compose.yml | 2 +- .../microsoft-windows-10 => iis}/Dockerfile | 31 ++++++- .../microsoft-windows-10 => iis}/Makefile | 0 win32/ecosystem/epicmorg/iis/README.md | 4 + .../docker-compose.yml | 2 +- 7 files changed, 103 insertions(+), 32 deletions(-) delete mode 100644 win32/ecosystem/epicmorg/base/microsoft-windows-10/README.md rename win32/ecosystem/epicmorg/{base/microsoft-windows-10 => iis}/Dockerfile (69%) rename win32/ecosystem/epicmorg/{base/microsoft-windows-10 => iis}/Makefile (100%) create mode 100644 win32/ecosystem/epicmorg/iis/README.md rename win32/ecosystem/epicmorg/{base/microsoft-windows-10 => iis}/docker-compose.yml (58%) diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-10/README.md b/win32/ecosystem/epicmorg/base/microsoft-windows-10/README.md deleted file mode 100644 index 0a93e9758..000000000 --- a/win32/ecosystem/epicmorg/base/microsoft-windows-10/README.md +++ /dev/null @@ -1,4 +0,0 @@ -![Windows-ready Docker Image](https://avatars2.githubusercontent.com/u/6154722?v=3&s=200) -# Windows-ready Docker Image - -* based on https://hub.docker.com/_/microsoft-windows diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/Dockerfile b/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/Dockerfile index 6704e2b9a..465cb4b20 100644 --- a/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/Dockerfile +++ b/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/Dockerfile @@ -1,64 +1,115 @@ -FROM mcr.microsoft.com/windows/servercore:1809-amd64 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" -ENV chocolateyUseWindowsCompression false - #################################################################################################################################### # https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile #################################################################################################################################### +ENV chocolateyUseWindowsCompression false +# Opt out of the telemetry feature +ENV DOTNET_CLI_TELEMETRY_OPTOUT=true +# Disable first time experience +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true +# Configure Kestrel web server to bind to port 80 when present +ENV ASPNETCORE_URLS=\ +# Enable detection of running in a container +ENV DOTNET_RUNNING_IN_CONTAINER=true +# Enable correct mode for dotnet watch (only mode supported in a container) +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +# Skip extraction of XML docs - generally not useful within an image/container - helps perfomance +ENV NUGET_XMLDOC_MODE=skip +# PowerShell telemetry for docker image usage +ENV POWERSHELL_DISTRIBUTION_CHANNEL=docker-windows +# Enable detection of running in a container +ENV DOTNET_RUNNING_IN_CONTAINER=true +ENV COMPLUS_RUNNING_IN_CONTAINER=1 +ENV COMPLUS_NGenProtectedProcess_FeatureEnabled=0 + +################################################################## + +ENV EMG_WORKDIR=C:\\EpicMorg +ENV EMG_VOLDIR=C:\\EpicMorg\\mount + ################################################################## # Creating workdir for future ################################################################## RUN mkdir C:\\EpicMorg WORKDIR C:\\EpicMorg - -################################################################## -# Installing IIS -################################################################## -RUN powershell -Command Add-WindowsFeature Web-Server; \ - Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.10/ServiceMonitor.exe" -OutFile "C:\ServiceMonitor.exe" +VOLUME C:\\EpicMorg\\mount ################################################################## # Installing ocolatey.org ################################################################## RUN powershell -Command \ - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \ - iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +# set mirror of chocolatey to bypass ratelimits +RUN choco source disable -n=chocolatey +RUN choco source add -n=vault -s="https://repo.vault.center/artifactory/api/nuget/chocolatey" +RUN choco source ################################################################## # install vcredist packages ################################################################## -RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ - vcredist-all \ - vcredist140 \ +RUN cinst -y --force --ignore-checksums --allow-empty-checksums --ignoredetectedreboot \ +# vb5runtime \ + vjredist \ + visualfsharptools \ vcredist2005 \ vcredist2008 \ vcredist2010 \ vcredist2012 \ vcredist2013 \ vcredist2013 \ - vcredist2015 + vcredist2015 \ + vcredist2017 \ + vcredist-all \ + vcredist140 ################################################################## # install dotnet packages ################################################################## -RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ +RUN cinst -y --force --ignore-checksums --allow-empty-checksums --ignoredetectedreboot \ + dotnet1.1 \ + dotnetsdk1.1 \ + dotnet3.5 \ + dotnetfx \ + netfx-4.8-devpack \ dotnet \ dotnet-aspnetruntime \ dotnet-windowshosting \ dotnet-runtime \ + dotnet-desktopruntime \ dotnet-sdk \ powershell-core - + +# Apply patch to provide support for container limits +RUN curl -fSLo patch.msu https://download.microsoft.com/download/1/d/1/1d162522-821a-41c6-ba7d-74ff37b0e6c6/Windows10.0-KB9008395-x64-NDP48.msu && \ + mkdir patch&& \ + && expand patch.msu patch -F:* && \ + && del /F /Q patch.msu && \ + && dism /Online /Quiet /Add-Package /PackagePath:C:\patch\windows10.0-kb9008395-x64-ndp48.cab && \ + && rmdir /S /Q patch && \ +# Ngen top of assembly graph to optimize a set of frequently used assemblies + && %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen install "Microsoft.PowerShell.Utility.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" && \ + && %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen update && \ + && %windir%\Microsoft.NET\Framework\v4.0.30319\ngen update + +# To optimize 32-bit assemblies, uncomment the next line +# && %windir%\Microsoft.NET\Framework\v4.0.30319\ngen install "Microsoft.PowerShell.Utility.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" && \ + ################################################################## # install base packages ################################################################## -RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ +RUN cinst -y --force --ignore-checksums --allow-empty-checksums --ignoredetectedreboot \ + psexec \ curl \ far \ findutils \ git \ + git.install \ + git-lfs \ + git-lfs.install \ make \ mc \ nano \ @@ -74,7 +125,7 @@ RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ ################################################################## # install archive packages ################################################################## -RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ +RUN cinst -y --force --ignore-checksums --allow-empty-checksums --ignoredetectedreboot \ 7zip \ 7zip-zstd \ 7zip.commandline \ @@ -88,6 +139,3 @@ RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ wavpack7z \ winrar -EXPOSE 80 - -ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"] \ No newline at end of file diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/docker-compose.yml b/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/docker-compose.yml index 7be0cca18..3c4a5c734 100644 --- a/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/docker-compose.yml +++ b/win32/ecosystem/epicmorg/base/microsoft-windows-servercore/docker-compose.yml @@ -1,6 +1,6 @@ version: '3.9' services: app: - image: "epicmorg/prod:win-server-core" + image: "epicmorg/windows-server:2022-base" build: context: . diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-10/Dockerfile b/win32/ecosystem/epicmorg/iis/Dockerfile similarity index 69% rename from win32/ecosystem/epicmorg/base/microsoft-windows-10/Dockerfile rename to win32/ecosystem/epicmorg/iis/Dockerfile index 1e2668cff..c0d31cc3c 100644 --- a/win32/ecosystem/epicmorg/base/microsoft-windows-10/Dockerfile +++ b/win32/ecosystem/epicmorg/iis/Dockerfile @@ -1,7 +1,21 @@ -FROM mcr.microsoft.com/windows:1809-amd64 +FROM mcr.microsoft.com/windows/servercore:ltsc2022 LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" ENV chocolateyUseWindowsCompression false +# Opt out of the telemetry feature +ENV DOTNET_CLI_TELEMETRY_OPTOUT=true +# Disable first time experience +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true +# Configure Kestrel web server to bind to port 80 when present +ENV ASPNETCORE_URLS=\ +# Enable detection of running in a container +ENV DOTNET_RUNNING_IN_CONTAINER=true +# Enable correct mode for dotnet watch (only mode supported in a container) +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +# Skip extraction of XML docs - generally not useful within an image/container - helps perfomance +ENV NUGET_XMLDOC_MODE=skip +# PowerShell telemetry for docker image usage +ENV POWERSHELL_DISTRIBUTION_CHANNEL=docker-windows #################################################################################################################################### # https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile @@ -13,6 +27,12 @@ ENV chocolateyUseWindowsCompression false RUN mkdir C:\\EpicMorg WORKDIR C:\\EpicMorg +################################################################## +# Installing IIS +################################################################## +RUN powershell -Command Add-WindowsFeature Web-Server; \ + Invoke-WebRequest -UseBasicParsing -Uri "https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.10/ServiceMonitor.exe" -OutFile "C:\ServiceMonitor.exe" + ################################################################## # Installing ocolatey.org ################################################################## @@ -38,8 +58,9 @@ RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ # install dotnet packages ################################################################## RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ - directx \ dotnet \ + dotnet-aspnetruntime \ + dotnet-windowshosting \ dotnet-runtime \ dotnet-sdk \ powershell-core @@ -51,7 +72,6 @@ RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ curl \ far \ findutils \ - ffmpeg-shared \ git \ make \ mc \ @@ -81,4 +101,7 @@ RUN cinst --no-progress -y -IgnoreChecksums --ignoredetectedreboot \ thumbs7z \ wavpack7z \ winrar - \ No newline at end of file + +EXPOSE 80 + +ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"] \ No newline at end of file diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-10/Makefile b/win32/ecosystem/epicmorg/iis/Makefile similarity index 100% rename from win32/ecosystem/epicmorg/base/microsoft-windows-10/Makefile rename to win32/ecosystem/epicmorg/iis/Makefile diff --git a/win32/ecosystem/epicmorg/iis/README.md b/win32/ecosystem/epicmorg/iis/README.md new file mode 100644 index 000000000..13d48defa --- /dev/null +++ b/win32/ecosystem/epicmorg/iis/README.md @@ -0,0 +1,4 @@ +![IIS Docker Image](https://avatars2.githubusercontent.com/u/6154722?v=3&s=200) +# IIS-ready Docker Image + +* based on https://github.com/microsoft/iis-docker diff --git a/win32/ecosystem/epicmorg/base/microsoft-windows-10/docker-compose.yml b/win32/ecosystem/epicmorg/iis/docker-compose.yml similarity index 58% rename from win32/ecosystem/epicmorg/base/microsoft-windows-10/docker-compose.yml rename to win32/ecosystem/epicmorg/iis/docker-compose.yml index 847250482..21c7c4d0e 100644 --- a/win32/ecosystem/epicmorg/base/microsoft-windows-10/docker-compose.yml +++ b/win32/ecosystem/epicmorg/iis/docker-compose.yml @@ -1,6 +1,6 @@ version: '3.9' services: app: - image: "epicmorg/prod:win10" + image: "epicmorg/windows-server:base" build: context: .