Contents tagged with Dockerfile
today I want to write few words about how to instal latest Nuget into Windows docker container. For this purpose you can use following commands:
RUN mkdir c:\NugetRUN Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe' -OutFile 'c:\Nuget\nuget.exe'; \ $env:PATH = $env:PATH + 'c:\Nuget\;c:\Nuget'; \ Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH more
today I want to share another piece of code, that proved to be helpful for me in creating docker containers.
Here it is:
Start-Process c:\sdksetup.exe -ArgumentList '/Quiet /NoRestart' -Wait; \
First time when I seen it I was sceptical. Why I should use Start-Process instead of just running application? The answer is simple: because quite often installers just execute some processes and give control to powershell in asyncronous way. And if other parts of your docker image are dependable from your sdksetup.exe, then you'll not get needed container.
For example you can install Dot net 4.6.2 package in the following way:
RUN Invoke-WebRequest 'https://download.microsoft. … more
recently I had following issue:
copy folder dotnet-dev-win-x18.104.22.168 into c:\Program Files\Dotnet in container. After different dancing and triings I've found following command that worked:
COPY ["dotnet-dev-win-x22.214.171.124", "c:/Program Files/dotnet"] more
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 'https://download.microsoft.com/download/1/1/4/114223DE-0AD6-4B8A-A8FB-164E5862AF6E/dotnet-dev-win-x126.96.36.199.exe' -OutFile dotnetDev.exeRUN .\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 'https://github.com/git-for-windows/git/releases/download/v2.12.2.windows.2/MinGit-188.8.131.52-64-bit.zip' -OutFile MinGit.zip
RUN Expand-Archive c:\ … more
today I want to write a few words about Dockerfile.
So, as usually for developer it will not be enough just ordinary docker images. Quite often they need to add some more features to docker images. One of the useful ways to organize it can be creating Dockerfile.
Dockerfile in itself just a text file with instructions. Of course that instructions are docker specific. And it's similar to making program say in C#. While after C# program I need to execute compiler, with Dockerfile I need to execute command docker build. You can consider docker build as compiler from Docker.
Executed image is a container.
Dockerfile has build instructions.
Some docker instructions … more