Unable to run a commandline tool in Windows docker container

Continuing the discussion from Unable to execute a helloworld exe in MS windows server core container:

I am trying to run a .exe installed in a windows docker container. It is a command-line tool that just converts a type of file into .csv.
I have been able to install the software in the container, however, when I try to run the command in the Dockerfile, it fails with the following error code: 3221225794
I have also tried removing the command from the Dockerfile and running the container, and tried to run the zph2csv – help from the container cmd. No output or error was displayed.

I am struggling to understand what the issue is.

Here is my dockerfile:

# Use an official Windows Server Core image
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["powershell", "-Command", "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue';"]
# RUN Install-WindowsFeature Containers -ArgumentList 'norestart'
# SHELL ["powershell", "Enable-WindowsOptionalFeature -Online -FeatureName Containers -All"]

# Set the working directory

RUN Write-Output "test output"

# Copy your .exe and Python script into the container
COPY Setup_ZPH2CSV_v1.7.0.1.exe /src
COPY src /src
COPY Wind10_755@Y2023_M10_D05.ZPH /src

# RUN Get-ChildItem

# Install Python
# -------working--------
# RUN Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.8.0/python-3.8.0-amd64.exe" -OutFile "python-installer.exe"; \
#     Start-Process python-installer.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 IncludePip=1' -Wait;
# RUN python --version
# RUN pip install boto3
# --------------------------
    # Start-Process python-installer.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 IncludePip=1' -Wait; \
#     # Remove-Item python-installer.exe

# # Test Python installation
# RUN python --version
# # # Install boto3
# RUN pip install boto3

USER ContainerAdministrator

# # Install ZPH2CSV
RUN Write-Output "Starting Installation"; \
    Start-Process Setup_ZPH2CSV_v1.7.0.1.exe -ArgumentList '/install', 'C:/ZPH2CSV', '/silent InstallAllUsers=1 PrependPath=1' -Wait; \
    Write-Output "Installation Complete";

RUN ["zph2csv", "--help"]

The last command, is the one that should output the help of the commandline tool, but it exits with the error code. I would really appreciate some help as I am new to windows containers.

Why continuing? I don’t see how the linked topic is related except that both are issues in Windows containers.

Or did you try to find the dependencies as mentioned in the other topic?

Can you try to install it on the Windows host?

I have installed the .exe on my windows machine and it works just fine.
It gets installed in the container too, I was able to locate the installation directory in the container.
However, it throws the error code when I try to run the command.

How can I check what the exe is missing in the container? It runs fine on a windows machine, just doesn’t run in a windows container. I have tried on both Windows 10 and Windows 11 host.

Usually all our qustions have a reason, to help us understand the issue. Can you please answer the above?

I couldn’t tell you as I don’t use Windows containers and I mostly work on Linux anyway, but since you mentioned the other topic, you must have seen this comment:

This is what I referred to in my second (ignored) question in my previous post.

Using containers requires a deeper knowledge about the operating system. When I work with Linux containers, I often have to find the dependencies and sometimes it takes a lot of time. It could be similar on Windows, except the solution is different and I don’t know that.

Instead of using servercore image, first try to use full windows image


Servercore is small image which is missing a lot of windows dlls, and that might be why your exe is not working