I took the following steps to resolve this issue:
- Got hold of the Windows Server 2016 Core ISO file. Mounted the file on local computer.
- Extracted the {mount}:/sources/sxs folder into a zip file (sxs.zip). Ensure that the .NET Framework 3.5 cab file (microsoft-windows-netfx3-ondemand-package.cab) is present in the sxs folder. In my case, this was the only file present in the sxs folder.
- Copy the sxs.zip file to my container. I copied it using the dockerfile of the image.
- Unzip the file to C:sourcessxs folder in the container.
-
Used the Install-WindowsFeature powershell command to install the feature.
Install-WindowsFeature -Name NET-Framework-Features -Source C:sourcessxs -Verbose
Hope this helps. I also found the following blog useful in understanding the on-demand features.
https://blogs.technet.microsoft.com/askcore/2012/05/14/windows-8-and-net-framework-3-5/