How To Add To Docker Image Dot Net Sdk And Other Useful Staff


Hello everybody,

today I want to write few rakes of Dockerfile.

First of all I want to document how to install dot net sdk 1.1. It isn't installable by chocolatey, so I had to use following workaround:

RUN Invoke-WebRequest '' -OutFile dotnetDev.exe
RUN .\dotnetDev.exe /Silent /Full

Another issue, that I faced was installing of Git, or for containers I prefer MinGit. It can be achieved in the following way:

RUN Invoke-WebRequest '' -OutFile

RUN Expand-Archive c:\ -DestinationPath c:\MinGit; \
$env:PATH = $env:PATH + ';C:\MinGit\cmd\;C:\MinGit\cmd'; \
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH

If you have need for dockerfile to execute powershell (as I like to do) the following command in docker file can be needed:

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

No Comments

Add a Comment


Comments are closed