Gluonfx build using docker fails, with error: Cannot run program "ie4uinit": CreateProcess error=2, The system cannot find the file specified

Gluonfx build using docker fails, with error: Cannot run program "ie4uinit": CreateProcess error=2, The system cannot find the file specified

我正在使用 Gluonfx 插件构建原生图像。我在 docker 容器中执行此过程。 该图像构建了 7 个步骤,但是执行 link 会引发错误,抱怨缺少 ie4uinit.exe.

这些是错误日志:

[Mon Mar 28 21:14:21 UTC 2022][INFO] Substrate is tested with the Gluon's GraalVM build which you can find at https://github.com/gluonhq/graal/releases.
While you can still use other GraalVM builds, there is no guarantee that these will work properly with Substrate
[Mon Mar 28 21:14:22 UTC 2022][INFO] ==================== LINK TASK ====================
[Mon Mar 28 21:14:22 UTC 2022][INFO] Default icon.ico image generated in C:\temp\target\gluonfx\x86_64-windows\gensrc\windows\assets.
Consider copying it to C:\temp\src\windows before performing any modification
[Mon Mar 28 21:14:22 UTC 2022][INFO] [SUB] Microsoft (R) Incremental Linker Version 14.31.31104.0
[Mon Mar 28 21:14:22 UTC 2022][INFO] [SUB] Copyright (C) Microsoft Corporation.  All rights reserved.
[Mon Mar 28 21:14:22 UTC 2022][INFO] [SUB]
[Mon Mar 28 21:14:22 UTC 2022][INFO] [SUB]    Creating library C:\temp\target\gluonfx\x86_64-windows\X XXX.lib and object C:\temp\target\gluonfx\x86_64-windows\X XXX.exp
java.io.IOException: Cannot run program "ie4uinit": CreateProcess error=2, The system cannot find the file specified
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
        at com.gluonhq.substrate.util.ProcessRunner.setupProcess(ProcessRunner.java:378)
        at com.gluonhq.substrate.util.ProcessRunner.runProcess(ProcessRunner.java:236)
        at com.gluonhq.substrate.util.ProcessRunner.runProcess(ProcessRunner.java:222)
[INFO] ------------------------------------------------------------------------
        at com.gluonhq.substrate.target.WindowsTargetConfiguration.clearExplorerCache(WindowsTargetConfiguration.java:276)
        at com.gluonhq.substrate.target.WindowsTargetConfiguration.link(WindowsTargetConfiguration.java:224)
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
        at com.gluonhq.substrate.SubstrateDispatcher.nativeLink(SubstrateDispatcher.java:443)
        at com.gluonhq.NativeLinkMojo.execute(NativeLinkMojo.java:47)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:301)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:211)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:165)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:157)
[INFO] Total time:  06:39 min
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:121)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:127)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:294)
[INFO] Finished at: 2022-03-28T21:14:25Z
[INFO] ------------------------------------------------------------------------
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:960)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)

我想知道是否可以将此依赖项添加到我的 docker 图像中。或者,如果不可能,通过配置抑制在 gluonfx 中使用它的可能方法。

Docker 图片:

# escape=`
# Use the latest Windows Server Core image with .NET Framework 4.8.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

RUN `
    # Download the Build Tools bootstrapper.
    curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
    `
    # Install Build Tools, excluding workloads and components with known issues.
    && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache modify `
        --installPath "%ProgramFiles(x86)%\Microsoft Visual Studio22\BuildTools" `
        --add Microsoft.VisualStudio.Workload.AzureBuildTools `
        --add Microsoft.VisualStudio.Workload.VCTools `
        --add Microsoft.VisualStudio.Component.VC.140 `
        --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
        --add Microsoft.VisualStudio.Component.VC.CMake.Project `
        --add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
        --add Microsoft.VisualStudio.Component.VC.Llvm.Clang `
        --add Microsoft.Net.Component.4.8.SDK `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
        --remove Microsoft.VisualStudio.Component.Windows81SDK `
        || IF "%ERRORLEVEL%"=="3010" EXIT 0) `
    `
    # Cleanup
    && del /q vs_buildtools.exe

#Installing GraalVM
ADD https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-windows-amd64-22.0.0.2.zip /
RUN powershell -Command "expand-archive -Path 'c:\graalvm-ce-java11-windows-amd64-22.0.0.2.zip' -DestinationPath 'c:\'"

#ADD  https://download2.gluonhq.com/substrate/javafxstaticsdk/openjfx-18-ea+14-windows-x86_64-static.zip / C:\Users\ContainerAdministrator\.gluon\substrate\

#Installing Maven
ADD https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.zip /
RUN powershell -Command "expand-archive -Path 'c:\apache-maven-3.8.5-bin.zip' -DestinationPath 'c:\'"

ENV JAVA_HOME C:\graalvm-ce-java11-22.0.0.2\
ENV MAVEN_HOME C:\apache-maven-3.8.5\
ENV GRAALVM_HOME C:\graalvm-ce-java11-22.0.0.2\
ENV JAVA_OPTS -Xmx1g
RUN setx PATH "%PATH%;%JAVA_HOME%\bin;%MAVEN_HOME%\bin"

WORKDIR C:/temp/

# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

终于找到了解决办法: 将基础 docker 图像更改为:mcr.microsoft.com/windows:1809-amd64

这个包含完成构建过程所必需的依赖项。 这终于是我的 Dockerfile(无论如何,如果您知道更轻的图像或 docker 配置来使用 gluonfx 执行构建,请在评论中 post。我将不胜感激):

# escape=`
# Use A windows base image.
FROM mcr.microsoft.com/windows:1809-amd64

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

RUN `
    # Download the Build Tools bootstrapper.
    curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
    `
    # Install Build Tools, excluding workloads and components with known issues.
    && (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
        --installPath "C:\Program Files (x86)\Microsoft Visual Studio22\BuildTools" `
        --add Microsoft.VisualStudio.Workload.AzureBuildTools `
        --add Microsoft.VisualStudio.Workload.VCTools `
        --add Microsoft.VisualStudio.Component.VC.140 `
        --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
        --add Microsoft.VisualStudio.Component.VC.CMake.Project `
        --add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
        --add Microsoft.VisualStudio.Component.VC.Llvm.Clang `
        --add Microsoft.Net.Component.4.8.SDK `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
        --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
        --remove Microsoft.VisualStudio.Component.Windows81SDK `
        || IF "%ERRORLEVEL%"=="3010" EXIT 0) `
    `
    # Cleanup
    && del /q vs_buildtools.exe

#Installing GraalVM
ADD https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-windows-amd64-22.0.0.2.zip /
RUN powershell -Command "expand-archive -Path 'c:\graalvm-ce-java11-windows-amd64-22.0.0.2.zip' -DestinationPath 'c:\'"

#Installing Maven
ADD https://dlcdn.apache.org/maven/maven-3/3.8.5/binaries/apache-maven-3.8.5-bin.zip /
RUN powershell -Command "expand-archive -Path 'c:\apache-maven-3.8.5-bin.zip' -DestinationPath 'c:\'"

ENV JAVA_HOME C:\graalvm-ce-java11-22.0.0.2\
ENV MAVEN_HOME C:\apache-maven-3.8.5\
ENV GRAALVM_HOME C:\graalvm-ce-java11-22.0.0.2\
ENV JAVA_OPTS -Xmx1g
RUN setx PATH "%PATH%;%JAVA_HOME%\bin;%MAVEN_HOME%\bin"

WORKDIR C:/temp/

# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]