4

I want to use microsoft/nanoserver as base image for my requirement and want to install 'vc_redist.x64' package into it but I am not able to install as it returns some error as shown below:

enter image description here

and this is my Dockerfile:

FROM microsoft/nanoserver
MAINTAINER <org name>
ADD . /
CMD ["powershell", "c:/scripts/start.ps1"]
ADD https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe /vc_redist.x64.exe
RUN C:\vc_redist.x64.exe /quiet /install

However if I use 'microsoft/windowsservercore' the base image size increases rapidly and it goes to 12+ GB. having large base image size does not fit in my requirement.

Is there any way to install 'vc_redist.x64' in 'microsoft/nanoserver' with its dependencies?

Any help is much appreciated.

Amit Gawali
  • 270
  • 2
  • 4
  • 18

1 Answers1

0

Visual C++ Redistributable Packages cannot be installed in NanoServer. However, you can use the binary dlls manually. The redistributable files are installed with Visual Studio.

Steps:

  1. Open Visual Studio Installer, make sure you check Desktop Development with C++. At right details panel, check all versions you want to install:

    • MSVC v143 - VS 2022
    • MSVC v142 - VS 2019
    • MSVC v141 - VS 2017
    • MSVC v140 - VS 2015
  2. Find your VS installation folder, for example, VS2022 should be like C:\Program Files\Microsoft Visual Studio\2022\Community and VS2019 should be C:\Program Files (x86)\Microsoft Visual Studio\2019\Community. Then go to the CRT folder. I have installed VS2022 and want to use MSVC v142, so the full path should be: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.29.30133\onecore\x64\Microsoft.VC142.CRT

  3. Copy everything under this folder to your application's local folder, or C:\Windows\System32 in your NanoServer image.

Kaedei
  • 1
  • 1