Coder Social home page Coder Social logo

Comments (23)

shirhatti avatar shirhatti commented on July 18, 2024 16

This should do the trick See updated suggestion.

FROM microsoft/dotnet-framework:4.6.2

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

# Rest of your Dockerfile

from dotnet-framework-docker.

nkamatam avatar nkamatam commented on July 18, 2024 5

from dotnet-framework-docker.

mmikkola avatar mmikkola commented on July 18, 2024 4

I'm using the following:

# escape=`
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
	Invoke-WebRequest "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe"; `
	Start-Process -filepath C:\vc_redist.x64.exe -ArgumentList "/install", "/passive", "/norestart" -Passthru | Wait-Process; `
	Remove-Item -Force vc_redist.x64.exe;

It works for me and should be more in line with the Best practices.

from dotnet-framework-docker.

mlapaglia avatar mlapaglia commented on July 18, 2024 1

@nkamatam you'll need to put that command into your dockerfile, not run manually from your command line.

from dotnet-framework-docker.

MichaelSimons avatar MichaelSimons commented on July 18, 2024 1

I have a refined suggestion that follows the Dockerfile best practices. The previous suggestion is not optimal from a layer perspective.

# escape=`

#  Change the base image as appropriate for your scenario.
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8

USER ContainerAdministrator
RUN curl -fSLo vc_redist.x64.exe https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe `
    && start /w vc_redist.x64.exe /install /quiet /norestart `
    && del vc_redist.x64.exe

from dotnet-framework-docker.

akozyreva avatar akozyreva commented on July 18, 2024 1

Hi everyone!
Thanks a lot for your help! Bellow is my part which works great!

# Visual C++ 2015 Multithreaded Runtime DLLs (vcruntime140.dll)
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "vc_redist.x64.exe"; \
	Start-Process -filepath C:\vc_redist.x64.exe -ArgumentList "/install", "/passive", "/norestart" -Passthru | Wait-Process; \
	Remove-Item -Force vc_redist.x64.exe;

# Visual C++ 2013 Multithreaded Runtime DLLs (msvcp120.dll and msvcr120.dll)
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
	Invoke-WebRequest "https://aka.ms/highdpimfc2013x64enu" -OutFile "vc_redist.x64.exe"; \
	Start-Process -filepath C:\vc_redist.x64.exe -ArgumentList "/install", "/passive", "/norestart" -Passthru | Wait-Process; \
	Remove-Item -Force vc_redist.x64.exe;	

from dotnet-framework-docker.

andreymir avatar andreymir commented on July 18, 2024

Thanks!

from dotnet-framework-docker.

nkamatam avatar nkamatam commented on July 18, 2024

RUN C:\vc_redist.x64.exe /quiet /install - does not work for me. I ran it from the cmd prompt from within the container, I just get the prompt back immediately without any work/install getting done.

from dotnet-framework-docker.

VikasAgarwal1984 avatar VikasAgarwal1984 commented on July 18, 2024

@mlapaglia It work for me when i put in docker file, but it does not work when i try to install it from container. Is there any reason to it? As i was trying to run helloworld exe but it is still not printing to console after above installation as well. I verified in registry also.

from dotnet-framework-docker.

S93rastogi avatar S93rastogi commented on July 18, 2024

Is the installation of VC runtime does not work with "mcr.microsoft.com/dotnet/core/aspnet:2.1" base image which is basically of ASP.NET CORE. If I try the dotnet framework base image VC runtime gets installed. Is the reason on mentioned here
https://social.msdn.microsoft.com/Forums/aspnet/en-US/67425dcd-6812-4b52-81a8-f85c0e4e7d59/error-3221225781-when-running-existing-applications-in-docker?forum=windowscontainers

from dotnet-framework-docker.

Escoto avatar Escoto commented on July 18, 2024

This should do the trick

FROM microsoft/dotnet-framework:4.6.2

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

# Rest of your Dockerfile

Hi,
I am having issues with this solution, I am getting this error, can i get some help?
container eec... encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e)

from dotnet-framework-docker.

MichaelSimons avatar MichaelSimons commented on July 18, 2024

@Escoto, That error seems orthogonal to your Dockerfile and is a general Windows Docker issue. The username or password part is interesting. I would suggest posting this on the windows containers forum.

from dotnet-framework-docker.

BranigansLaw avatar BranigansLaw commented on July 18, 2024

I have a refined suggestion that follows the Dockerfile best practices. The previous suggestion is not optimal from a layer perspective.

# escape=`

#  Change the base image as appropriate for your scenario.
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8

USER ContainerAdministrator
RUN curl -fSLo vc_redist.x64.exe https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe `
    && start /w vc_redist.x64.exe /install /quiet /norestart `
    && del vc_redist.x64.exe

I'm fairly new to Dockerfiles, but the following gave me an error:

The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; curl -fSLo vc_redist.x86.exe https://aka.ms/vs/16/release/vc_redist.x86.exe     && start /w vc_redist.x86.exe /install /quiet /norestart     && del vc_redist.x86.exe' returned a non-zero code: 1

I switched it out for @MichaelSimons's solution and that works much better.

from dotnet-framework-docker.

wilbit avatar wilbit commented on July 18, 2024

I have a refined suggestion that follows the Dockerfile best practices. The previous suggestion is not optimal from a layer perspective.

# escape=`

#  Change the base image as appropriate for your scenario.
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8

USER ContainerAdministrator
RUN curl -fSLo vc_redist.x64.exe https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe `
    && start /w vc_redist.x64.exe /install /quiet /norestart `
    && del vc_redist.x64.exe

Does not work to me. I get Access Denied error on start /w vc_redist.x64.exe /install /quiet /norestart command
The first suggestion does the trick!

from dotnet-framework-docker.

abaghum avatar abaghum commented on July 18, 2024

None of these work

from dotnet-framework-docker.

vinothprasathCS avatar vinothprasathCS commented on July 18, 2024

Hi All, I am using Podman instead of Docker.. Can i use C++ Redistributable in podman container since its linux based..?

from dotnet-framework-docker.

mthalman avatar mthalman commented on July 18, 2024

Hi All, I am using Podman instead of Docker.. Can i use C++ Redistributable in podman container since its linux based..?

What is your scenario for using this in the context of Linux?

from dotnet-framework-docker.

engarde avatar engarde commented on July 18, 2024

Podman will support your use of wsl(2) based linux images on a Windows host but not a lot of call for visual c runtime in that case.

from dotnet-framework-docker.

Jens-G avatar Jens-G commented on July 18, 2024

This does not work if the image is Nano Server 64 based, because the installer is a 32 bit app and immediately terminates with exit code 3221225781 on that system.

from dotnet-framework-docker.

SCLDGit avatar SCLDGit commented on July 18, 2024

What would need to be done to the dotnet/sdk or dotnet/aspnet base images to get this working correctly? Our application leverages sqlcipher, which won't run without the redist. I can get it running on windows:ltsc2019, but the image size is enormous.

from dotnet-framework-docker.

MichaelSimons avatar MichaelSimons commented on July 18, 2024

@SCLDGit - Have you tried this suggestion?

from dotnet-framework-docker.

SCLDGit avatar SCLDGit commented on July 18, 2024

@SCLDGit - Have you tried this suggestion?

Yep. After giving it some more thought I'm thinking it's because the dotnet sdk and aspnet images are meant to run cross platform on both wsl and hyper-v containers, which vcredist is obviously a Windows only package.

from dotnet-framework-docker.

MichaelSimons avatar MichaelSimons commented on July 18, 2024

@SCLDGit - Have you tried this suggestion?

Yep. After giving it some more thought I'm thinking it's because the dotnet sdk and aspnet images are meant to run cross platform on both wsl and hyper-v containers, which vcredist is obviously a Windows only package.

I missed that you were asking about the .NET (Core) images and the not .NET Framework images. You should be able to install redist on the .NET Windows Server Core images. As you noted it won't work with the Linux images and it also won't work on the Nano Server images.

from dotnet-framework-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.