Last active
August 16, 2022 17:24
-
-
Save ashalkhakov/cc2bc798caecb52ed123f9a8ed0e575d to your computer and use it in GitHub Desktop.
Running .NET 3.5 CF builds under Docker for Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is the GitLab-CI file for building the image | |
variables: | |
CURRENT_IMAGE_TAG: rfid-applied/netcf35_build_environment:dev | |
stages: | |
- dockerize | |
dockerize: | |
stage: dockerize | |
script: | |
- docker build -t %CURRENT_IMAGE_TAG% . | |
- docker push %CURRENT_IMAGE_TAG% | |
- docker rmi %CURRENT_IMAGE_TAG% | |
tags: | |
- my-windows-containers-machine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM microsoft/dotnet-framework-build:3.5 | |
# .NET Compact Framework 3.5 Redistributable: | |
# https://www.microsoft.com/en-us/download/details.aspx?id=65 | |
RUN powershell Invoke-WebRequest -Uri "https://download.microsoft.com/download/c/b/e/cbe1c611-7f2f-4bcf-921d-2df718591e1e/NETCFSetupv35.msi" -Out netfx35cf.msi | |
# we HAVE to install it like this, otherwise it won't wait for install | |
# to finish (UGH!) | |
RUN powershell "Start-Process -file "c:\netfx35cf.msi" -arg ' /qn /l*v c:\install_netfx35cf.txt' -passthru | wait-process" | |
RUN "cat c:\install_netfx35cf.txt" | |
RUN "del c:\*netfx35cf.*" | |
# Power Toys for .NET Compact Framework 3.5: | |
RUN powershell Invoke-WebRequest -Uri "https://download.microsoft.com/download/f/a/c/fac1342d-044d-4d88-ae97-d278ef697064/NETCFv35PowerToys.msi" -Out toys.msi | |
RUN powershell "Start-Process -file "c:\toys.msi" -arg ' /qn /l*v c:\install_toys.txt' -passthru | wait-process" | |
RUN "cat c:\install_toys.txt" | |
RUN "del c:\*toys.*" | |
# NuGet | |
ADD "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" "c:\nuget.exe" |
Thank you @objt-ba, fixed it. It worked for me as-is, but that was more than a year ago.
It's a great script ! :) So, thank you !
After more testing, also found that the piping with wait-process
also needs it.
So, I wrapped the entire thing in quotes, as follows:
RUN powershell "Start-Process -file 'c:\netfx35cf.msi' -arg ' /qn /l*v c:\install_netfx35cf.txt' -passthru | wait-process"
...
RUN powershell "Start-Process -file 'c:\toys.msi' -arg ' /qn /l*v c:\install_toys.txt' -passthru | wait-process"
But that's all.
Great, thank you for the input! Happy that you found it useful.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following gave me an exception, "Invoke-WebRequest is not recognized ...".
But it works fine like:
The same applies for the
Start-Process
commands.