Created
January 21, 2022 22:17
-
-
Save steviecoaster/5d25f511cb2850787974c5cb54e38dfc to your computer and use it in GitHub Desktop.
Quickly spin up Chocolatey's Docker image
This file contains hidden or 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
function Start-ChocoBuild { | |
[cmdletBinding()] | |
Param( | |
[Parameter()] | |
[ValidateSet('Debug','Official')] | |
[String] | |
$Type = 'Debug' | |
) | |
process { | |
Write-Verbose "Building from $PWD" | |
$buildType = Switch ($Type) { | |
'Debug' { 'build.debug.sh'} | |
'Official' { 'build.official.sh'} | |
} | |
$dockerArgs = @('build','-t','choco:latest-linux', '-f','docker/Dockerfile.linux','.','--build-arg',"buildscript=$buildType") | |
& docker @dockerArgs | |
} | |
} |
This file contains hidden or 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
function Start-ChocoContainer { | |
[Alias('choco')] | |
[CmdletBinding()] | |
Param() | |
process { | |
Write-Verbose "Running from $PWD" | |
$dockerArgs = @('run','-ti','--rm','choco:latest-linux','/bin/bash') | |
docker @dockerArgs | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment