''vc_redist.x64 does not install in microsoft/nanoserver image
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:
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.
Solution 1:[1]
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:
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
Find your VS installation folder, for example, VS2022 should be like
C:\Program Files\Microsoft Visual Studio\2022\Communityand VS2019 should beC:\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.CRTCopy everything under this folder to your application's local folder, or C:\Windows\System32 in your NanoServer image.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kaedei |

