Skip to content

Commit

Permalink
fix: Updating PipeScript.ps.dockerfile ( re #662 )
Browse files Browse the repository at this point in the history
Not using /Modules, loading other modules into the profile.
  • Loading branch information
James Brundage committed May 7, 2024
1 parent 6074916 commit 7e1b14a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Http.Server.Start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#>
param()
Push-Location $PSScriptRoot
$ImportedModules = Get-ChildItem -Path /Modules -Directory |
ForEach-Object { Import-Module $_.FullName -Global -Force -PassThru }
$ImportedModules = Get-Module


# Requests can be routed by piping into PSNode, which will start multiple PSNode jobs.
Expand Down
22 changes: 12 additions & 10 deletions PipeScript.ps.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@
#}

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

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

#{
# param($DockerInstallModules = @("Splatter", "PSSVG", "ugit", "Irregular") )
# $PowerShellPath = "opt/microsoft/powershell/7/pwsh"
# if ($DockerInstallModules) { "RUN $PowerShellPath --noprofile --nologo -c Install-Module '$($DockerInstallModules -join "','")' -Scope CurrentUser -Force"}
#}

#{
# $LoadedModuleInPath = (Get-Module | Split-Path) -match ([Regex]::Escape($pwd)) | Select -first 1
# if ($LoadedModuleInPath) { "COPY ./ ./Modules/$($LoadedModuleInPath | Split-Path -Leaf)" }
# $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" }
#}

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

0 comments on commit 7e1b14a

Please sign in to comment.