Created
October 22, 2019 16:44
-
-
Save adamdriscoll/7219d03837e22a43cd736d23dac06b6a to your computer and use it in GitHub Desktop.
Create a docker container image with Universal Dashboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module "$PSScriptRoot/UniversalDashboard.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.CodeEditor/1.0.1/UniversalDashboard.CodeEditor.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.Helmet/1.0.1/UniversalDashboard.Helmet.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.Style/1.0.0/UniversalDashboard.Style.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.Diagrams/1.0.1/UniversalDashboard.Diagrams.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.SyntaxHighlighter/1.0.0/UniversalDashboard.SyntaxHighlighter.psd1" | |
Import-Module "$PSScriptRoot/UniversalDashboard.ObjectTree/1.0.1/UniversalDashboard.ObjectTree.psd1" | |
# Provides the New-CustomDashboard cmdlet. | |
Import-Module "$PSScriptRoot/Dashboard/Dashboard.psd1" | |
$Dashboard = New-CustomDashboard | |
Start-UDDashboard -Dashboard $Dashboard -Port 8080 -Wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-Location $PSScriptRoot | |
$Staging = "$PSScriptRoot/stage" | |
Remove-Item $Staging -Force -Recurse -ErrorAction SilentlyContinue | |
New-Item $Staging -Force -ItemType Dir | Out-null | |
# This is where I have my dashboard.ps1 scripts and stuff. It's actually a module that contains cmdlets to create a dashboard. | |
Copy-Item -Path "$PSScriptRoot/../output-dashboard/" -Destination "$Staging/Dashboard" -Recurse | |
Save-Module -Name UniversalDashboard -Path $Staging -AcceptLicense -RequiredVersion 2.6.2 | |
Copy-Item -Path "$Staging/UniversalDashboard/2.6.2/*" -Destination $Staging -Container -Recurse | |
Remove-Item -Path "$Staging/UniversalDashboard/2.6.2" -Force -Recurse | |
Save-Module -Name UniversalDashboard.CodeEditor -Path $Staging -RequiredVersion 1.0.1 | |
Save-Module -Name UniversalDashboard.Helmet -Path $Staging -RequiredVersion 1.0.1 | |
Save-Module -Name UniversalDashboard.Style -Path $Staging -RequiredVersion 1.0 | |
Save-Module -Name UniversalDashboard.Diagrams -Path $Staging -RequiredVersion 1.0.1 | |
Save-Module -Name UniversalDashboard.SyntaxHighlighter -Path $Staging -RequiredVersion 1.0.0 | |
Save-Module -Name UniversalDashboard.ObjectTree -Path $Staging -RequiredVersion 1.0.1 | |
docker build . --tag=universaldashboardocker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/powershell:latest | |
LABEL description="Universal Dashboard Docker" | |
EXPOSE 8080 | |
COPY [ "./stage", "/home/" ] | |
COPY [ "./bootstrap.ps1", "/home/bootstrap.ps1" ] | |
ENTRYPOINT ["pwsh", "/home/bootstrap.ps1"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment