Docker Build fails when installing .NET Framework 3.5
Article # 3035539 - Page views: 547
Issue
Building a Kofax TotalAgility docker image fails during installation of .NET Framework 3.5
Cause
Installation of .NET 3.5 during Docker Build
The sample docker scripts provided with KTA copy .NET Framework 3.5 installation sources to C:\kta\NET-Framework35-Features. As part of the sample scripts, InstalledWindowsFeatures.ps1 uses this approach to install .NET Framework 3.5:
write-output "Installing Windows Feature .net framework 35" Install-WindowsFeature -Name NET-Framework-Features -Source C:\kta\NET-Framework35-Features -Verbose
However, this approach can fail, and may result in one of the following errors during the Docker build.
Windows Server 2016 error
Installing Windows Feature .net framework 35 VERBOSE: Installation started... VERBOSE: Continue with installation? VERBOSE: Prerequisite processing started... VERBOSE: Prerequisite processing succeeded. Install-WindowsFeature : The request to add or remove features on the specified server failed. Installation of one or more roles, role services, or features failed. The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. Error: 0x800f081f At C:\KTA\InstallWindowsFeatures.ps1:42 char:1 + Install-WindowsFeature -Name NET-Framework-Features -Source C:\kta\NE ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localh ost}:PSObject) [Install-WindowsFeature], Exception + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsof t.Windows.ServerManager.Commands.AddWindowsFeatureCommand
Windows Server 2019 error
Installing Windows Feature .net framework 35 VERBOSE: Installation started... VERBOSE: Continue with installation? VERBOSE: Prerequisite processing started... VERBOSE: Prerequisite processing succeeded. Install-WindowsFeature : The request to add or remove features on the specified server failed. Installation of one or more roles, role services, or features failed. The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. Error: 0x80070422 At C:\KTA\InstallWindowsFeaturesWithCleanup.ps1:39 char:1 + Install-WindowsFeature -Name NET-Framework-Features -Source C:\kta\NE ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (@{Vhd=; Credent...Name=localh ost}:PSObject) [Install-WindowsFeature], Exception + FullyQualifiedErrorId : DISMAPI_Error__Failed_To_Enable_Updates,Microsof t.Windows.ServerManager.Commands.AddWindowsFeatureCommand
Solution
This problem is caused by the fact that the Windows Update service is disabled by default in the base container from Microsoft, and the .NET Framework 3.5 installation fails with it disabled. The simplest way to resolve this problem is to simply enable the Windows Update service before the installation:
write-output "Installing Windows Feature .net framework 35" Set-Service -Name wuauserv -StartupType "Manual" Install-WindowsFeature -Name NET-Framework-Features -Source C:\kta\NET-Framework35-Features -Verbose
Level of Complexity
High
Applies to
Product | Version | Build | Environment | Hardware |
---|---|---|---|---|
Kofax TotalAgility | v7.7+ |
References
Article # 3035539