|
21 | 21 |
|
22 | 22 | #{
|
23 | 23 | # param($DockerInstallPackages = @("git","curl","ca-certificates","libc6","libgcc1","build-essential", "python3", "nodejs") )
|
24 |
| - # if ($DockerInstallPackages) {"RUN apt-get update && apt-get install -y $($dockerInstallPackages -join ' ')"} |
| 24 | + # if ($DockerInstallPackages) {"RUN apt-get update && apt-get install -y $($dockerInstallPackages -join ' ') && apt-get clean"} |
25 | 25 | #}
|
26 | 26 |
|
27 | 27 | #{
|
28 | 28 | # $LoadedModuleInPath = (Get-Module | Split-Path) -match ([Regex]::Escape($pwd)) | Select -first 1
|
29 | 29 | # if ($LoadedModuleInPath) { "COPY ./ ./usr/local/share/powershell/Modules/$($LoadedModuleInPath | Split-Path -Leaf)" }
|
30 | 30 | #}
|
31 | 31 |
|
| 32 | +SHELL ["pwsh", "-noprofile", "-nologo", "-command"] |
| 33 | + |
32 | 34 | #{
|
33 | 35 | # param($DockerInstallModules = @("Splatter", "PSSVG", "ugit", "Irregular") )
|
34 |
| - # $PowerShellPath = "opt/microsoft/powershell/7/pwsh" |
35 |
| - # $InstallModules = "Install-Module '$($DockerInstallModules -join "','")' -Scope CurrentUser -Force" |
36 |
| - # $NewProfile = "New-Item -ItemType File -Path \$Profile -Force" |
37 |
| - # $AddInstalled = "Add-Content -Value 'Import-Module $(@(@($DockerInstallModules) + $LoadedModuleInPath)) -join "','")' -Path \$Profile" |
38 |
| - # if ($DockerInstallModules) { "RUN $PowerShellPath --noprofile --nologo -c $InstallModules; $NewProfile | $AddInstalled" } |
| 36 | + # $PowerShellPath = "/bin/pwsh" |
| 37 | + # $InstallModules = "Install-Module '$($DockerInstallModules -join "','")' -AcceptLicense -Scope CurrentUser -Force" |
| 38 | + # $NewProfile = "New-Item -ItemType File -Path `$Profile -Force" |
| 39 | + # $AddInstalled = "Add-Content -Value 'Import-Module $(@($DockerInstallModules + $($LoadedModuleInPath | Split-Path -Leaf)) -join "','")'" |
| 40 | + # if ($DockerInstallModules) { "RUN @($InstallModules && $NewProfile | $AddInstalled)" -replace '\$', '\$' } |
39 | 41 | #}
|
40 | 42 |
|
41 | 43 | #{
|
42 | 44 | # param(<# A Script to Run When Docker Starts #>$Microservice = "./Http.Server.Start.ps1")
|
43 |
| - # if ($Microservice) { "COPY ./$Microservice ./$Microservice"} |
44 |
| - # if ($Microservice) { "RUN $PowerShellPath --noprofile --nologo -c 'Add-Content -Path \$Profile -Value ./$Microservice'"}"} |
| 45 | + # if ($Microservice) { "COPY $Microservice $Microservice"} |
| 46 | + # if ($Microservice) { "RUN Add-Content -Path \`$Profile -Value $Microservice" } |
45 | 47 | #}
|
46 | 48 |
|
0 commit comments