Skip to content

Commit 7e1b14a

Browse files
author
James Brundage
committed
fix: Updating PipeScript.ps.dockerfile ( re #662 )
Not using /Modules, loading other modules into the profile.
1 parent 6074916 commit 7e1b14a

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Http.Server.Start.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#>
1111
param()
1212
Push-Location $PSScriptRoot
13-
$ImportedModules = Get-ChildItem -Path /Modules -Directory |
14-
ForEach-Object { Import-Module $_.FullName -Global -Force -PassThru }
13+
$ImportedModules = Get-Module
1514

1615

1716
# Requests can be routed by piping into PSNode, which will start multiple PSNode jobs.

PipeScript.ps.dockerfile

+12-10
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,27 @@
2020
#}
2121

2222
#{
23-
# param($DockerInstallPackages = @("git","curl","ca-certificates","libc6","libgcc1") )
23+
# param($DockerInstallPackages = @("git","curl","ca-certificates","libc6","libgcc1","build-essential", "python3", "nodejs") )
2424
# if ($DockerInstallPackages) {"RUN apt-get update && apt-get install -y $($dockerInstallPackages -join ' ')"}
2525
#}
2626

27-
ENV PSModulePath ./Modules
27+
#{
28+
# $LoadedModuleInPath = (Get-Module | Split-Path) -match ([Regex]::Escape($pwd)) | Select -first 1
29+
# if ($LoadedModuleInPath) { "COPY ./ ./usr/local/share/powershell/Modules/$($LoadedModuleInPath | Split-Path -Leaf)" }
30+
#}
2831

2932
#{
3033
# param($DockerInstallModules = @("Splatter", "PSSVG", "ugit", "Irregular") )
3134
# $PowerShellPath = "opt/microsoft/powershell/7/pwsh"
32-
# if ($DockerInstallModules) { "RUN $PowerShellPath --noprofile --nologo -c Install-Module '$($DockerInstallModules -join "','")' -Scope CurrentUser -Force"}
33-
#}
34-
35-
#{
36-
# $LoadedModuleInPath = (Get-Module | Split-Path) -match ([Regex]::Escape($pwd)) | Select -first 1
37-
# if ($LoadedModuleInPath) { "COPY ./ ./Modules/$($LoadedModuleInPath | Split-Path -Leaf)" }
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" }
3839
#}
3940

4041
#{
41-
# param(<# A Script to Run When Docker Starts #>$DockerProfileScript = "./Http.Server.Start.ps1")
42-
# if ($DockerProfileScript) { "COPY ./$DockerProfileScript /root/.config/powershell/Microsoft.PowerShell_profile.ps1"}
42+
# 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'"}"}
4345
#}
4446

0 commit comments

Comments
 (0)