trouble debugging error with exit code 3221225781 (missing libraries) in windows docker container trouble debugging error with exit code 3221225781 (missing libraries) in windows docker container windows windows

trouble debugging error with exit code 3221225781 (missing libraries) in windows docker container


You need to install Visual C++ redistributable.

  1. Download the appropriate version of vc_redist.x64.exe and place it in the folder containing your Dockerfile
  2. Edit your Dockerfile so you preinstall VC++ redistributables when you build your image by adding:

    FROM mcr.microsoft.com/windows/sservercore

    WORKDIR c:\mydir

    COPY "vc_redist.x64.exe" .

    RUN vc_redist.x64.exe /install /passive /norestart /log out.txt

    COPY mydir/myprogram.exe c:\mydir

    CMD ["c:\mydir\myprogram.exe","someparameter"]

Your application should run now.

Note: you need 64-bit build of VC++ redistributable and the appropriate version. You can find some download urls here


This is quite an open-ended question, so it is not possible to give precise answer. Here are a few thoughts:

  1. This is your program that is missing a dependency. Presumably, you as the program author should be aware of what dependencies are required. You need to make sure to include them in your docker image, when you build it.
  2. You are creating your image based on Windows Core, which does not have the whole slew of UI components. This looks like the most obvious thing that could go wrong, given the symptoms. So what I would do is try and make sure that your program can run on Windows Core in principle. Which brings me to the next point.
  3. The most practical way to troubleshoot, in my opinion, is to remove Docker from the equation. You want to run your program on Windows Core. So setup a machine (physical or VM) with Windows Core inside and try to run your program there. There is a good chance that it won't run with the same symptoms. If that's the case, you now have reduced complexity, because you know that your problem has nothing to do with docker (or not).
  4. Finally, when you have your Windows Core machine up and running, you might be able to see a message box pop up with the error immediately (even on Core you can run some programs with UI can run, and message boxes are not an uncommon site), and failing that you can run sysinternals procmon/procexp even on Windows Core, so using those to locate missing dependencies could help. There is also Dependencies.

Note: by "Windows Core" in this answer I mean Core option of Windows Server