diff --git a/ubuntu.22.04/Dockerfile b/ubuntu.22.04/Dockerfile index 068dcf2..506623d 100644 --- a/ubuntu.22.04/Dockerfile +++ b/ubuntu.22.04/Dockerfile @@ -103,7 +103,7 @@ RUN wget --quiet -O - https://deb.nodesource.com/setup_${NodeJs_Version}.x | bas RUN curl -fsSL "https://pkgs.k8s.io/core:/stable:/v${Kubectl_Version}/deb/Release.key" | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v${Kubectl_Version}/deb/ /" | tee /etc/apt/sources.list.d/kubernetes.list && \ apt-get update && \ - apt-get install -y kubectl && \ + apt-get install -y kubectl=${Kubectl_Version}.* && \ rm -rf /var/lib/apt/lists/* # Install Kubelogin diff --git a/windows.ltsc2022/Dockerfile b/windows.ltsc2022/Dockerfile index f73bd17..9a2f497 100644 --- a/windows.ltsc2022/Dockerfile +++ b/windows.ltsc2022/Dockerfile @@ -24,8 +24,13 @@ ARG Octopus_Client_Version=14.3.1789 ARG Powershell_Version=7.4.6 ARG Python_Version=3.13.1 ARG ScriptCs_Version=0.17.1 +# Dotnet version depends on .NET runtime (currently 8.0) +ARG Dotnet_Script_Version=1.5.0 ARG Terraform_Version=1.10.4 +# Dotnet installation directory (matches path in update_path.cmd) +ARG Dotnet_Install_Dir=C:\Users\ContainerAdministrator\AppData\Local\Microsoft\dotnet + # Install Choco RUN $ProgressPreference = 'SilentlyContinue'; ` Set-ExecutionPolicy Bypass -Scope Process -Force; ` @@ -33,8 +38,10 @@ RUN $ProgressPreference = 'SilentlyContinue'; ` iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) # Install dotnet 8.0+ +# DOTNET_ROOT is required for dotnet tools to locate the runtime RUN Invoke-WebRequest 'https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1' -outFile 'dotnet-install.ps1'; ` [Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT', '1', 'Machine'); ` + [Environment]::SetEnvironmentVariable('DOTNET_ROOT', $Env:Dotnet_Install_Dir, 'Machine'); ` .\dotnet-install.ps1 -Channel '8.0'; ` rm dotnet-install.ps1 @@ -124,6 +131,9 @@ RUN choco install argocd-cli --yes --version $Env:Argo_Cli_Version --no-progress ADD .\scripts\update_path.cmd C:\update_path.cmd RUN .\update_path.cmd; +# Install dotnet-script, requires dotnet on path +RUN dotnet tool install -g dotnet-script --version $Env:Dotnet_Script_Version --add-source https://api.nuget.org/v3/index.json + # gcloud requires python on path, update_path.cmd adds python to path. Delete any backup files that exist (~1gb) RUN gcloud components install gke-gcloud-auth-plugin --quiet; ` if (Test-Path C:\google-cloud-sdk\.install\.backup) {Remove-Item -Path C:\google-cloud-sdk\.install\.backup -Force -Recurse} diff --git a/windows.ltsc2022/README.md b/windows.ltsc2022/README.md index b5f9662..af1111f 100644 --- a/windows.ltsc2022/README.md +++ b/windows.ltsc2022/README.md @@ -31,6 +31,7 @@ - Azure CLI 2.58.0 - Azure PowerShell 4.5.0 - Azure PowerShell Modules 11.3.0 +- Dotnet Script 1.5.0 - Eksctl 0.173.0 - Google Cloud CLI 467.0.0 - Google Cloud GKE auth plugin 467.0.0-0 / 0.5.8 diff --git a/windows.ltsc2022/scripts/update_path.cmd b/windows.ltsc2022/scripts/update_path.cmd index 0dcf5b6..46405ec 100644 --- a/windows.ltsc2022/scripts/update_path.cmd +++ b/windows.ltsc2022/scripts/update_path.cmd @@ -1,2 +1,2 @@ -setx /M path "%PATH%;C:\google-cloud-sdk\bin;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\dotnet;C:\Program Files\PackageManagement\NuGet\Packages\Octopus.Client.14.3.1248\lib\net462\Octopus.Client.dll" +setx /M path "%PATH%;C:\google-cloud-sdk\bin;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\dotnet;C:\Program Files\PackageManagement\NuGet\Packages\Octopus.Client.14.3.1248\lib\net462\Octopus.Client.dll;C:\Users\ContainerAdministrator\.dotnet\tools" diff --git a/windows.ltsc2022/spec/windows.ltsc2022.tests.ps1 b/windows.ltsc2022/spec/windows.ltsc2022.tests.ps1 index c9ec11b..f159a34 100644 --- a/windows.ltsc2022/spec/windows.ltsc2022.tests.ps1 +++ b/windows.ltsc2022/spec/windows.ltsc2022.tests.ps1 @@ -21,6 +21,11 @@ Describe 'installed dependencies' { $LASTEXITCODE | Should -be 0 } + It 'has dotnet-script installed' { + dotnet-script --version | Should -Match '1.5.0' + $LASTEXITCODE | Should -be 0 + } + It 'has java installed' { java -version 2>&1 | Select-String -Pattern '21\.0\.2' | Should -BeLike "*21.0.2*" $LASTEXITCODE | Should -be 0