From 0c1637ff00730ecec37a646a45acc5c6b3d0baef Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Tue, 7 May 2024 15:18:38 -0700 Subject: [PATCH] fix: Updating PipeScript.ps.dockerfile ( re #662 ) Using SHELL --- PipeScript.ps.dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PipeScript.ps.dockerfile b/PipeScript.ps.dockerfile index a70a9f675..aedbb6fd1 100644 --- a/PipeScript.ps.dockerfile +++ b/PipeScript.ps.dockerfile @@ -21,7 +21,7 @@ #{ # param($DockerInstallPackages = @("git","curl","ca-certificates","libc6","libgcc1","build-essential", "python3", "nodejs") ) - # if ($DockerInstallPackages) {"RUN apt-get update && apt-get install -y $($dockerInstallPackages -join ' ')"} + # if ($DockerInstallPackages) {"RUN apt-get update && apt-get install -y $($dockerInstallPackages -join ' ') && apt-get clean"} #} #{ @@ -29,18 +29,20 @@ # if ($LoadedModuleInPath) { "COPY ./ ./usr/local/share/powershell/Modules/$($LoadedModuleInPath | Split-Path -Leaf)" } #} +SHELL ["pwsh", "-noprofile", "-nologo", "-command"] + #{ # param($DockerInstallModules = @("Splatter", "PSSVG", "ugit", "Irregular") ) - # $PowerShellPath = "opt/microsoft/powershell/7/pwsh" - # $InstallModules = "Install-Module '$($DockerInstallModules -join "','")' -Scope CurrentUser -Force" - # $NewProfile = "New-Item -ItemType File -Path \$Profile -Force" - # $AddInstalled = "Add-Content -Value 'Import-Module $(@(@($DockerInstallModules) + $LoadedModuleInPath)) -join "','")' -Path \$Profile" - # if ($DockerInstallModules) { "RUN $PowerShellPath --noprofile --nologo -c $InstallModules; $NewProfile | $AddInstalled" } + # $PowerShellPath = "/bin/pwsh" + # $InstallModules = "Install-Module '$($DockerInstallModules -join "','")' -AcceptLicense -Scope CurrentUser -Force" + # $NewProfile = "New-Item -ItemType File -Path `$Profile -Force" + # $AddInstalled = "Add-Content -Value 'Import-Module $(@($DockerInstallModules + $($LoadedModuleInPath | Split-Path -Leaf)) -join "','")'" + # if ($DockerInstallModules) { "RUN @($InstallModules && $NewProfile | $AddInstalled)" -replace '\$', '\$' } #} #{ # param(<# A Script to Run When Docker Starts #>$Microservice = "./Http.Server.Start.ps1") - # if ($Microservice) { "COPY ./$Microservice ./$Microservice"} - # if ($Microservice) { "RUN $PowerShellPath --noprofile --nologo -c 'Add-Content -Path \$Profile -Value ./$Microservice'"}"} + # if ($Microservice) { "COPY $Microservice $Microservice"} + # if ($Microservice) { "RUN Add-Content -Path \`$Profile -Value $Microservice" } #}