Skip to content

Instantly share code, notes, and snippets.

@hebertcisco
Created February 16, 2022 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hebertcisco/076d40706c2f62bd53ce566d21373a1f to your computer and use it in GitHub Desktop.
Save hebertcisco/076d40706c2f62bd53ce566d21373a1f to your computer and use it in GitHub Desktop.
#!/usr/bin/env pwsh
function Docker-Build() {
$AppName = Read-Host -Prompt "Enter the name of the application: "
$Executor = 'docker '
$ExecutorArgs = 'build -t'
$GetArgsFinal = Read-Host -Prompt "Build to production OR development?: "
$ArgsFinal = '--target ' + $GetArgsFinal + ' .'
$Command = $Executor + $ExecutorArgs + ' ' + $AppName + ' ' + $ArgsFinal
Write-Output $Command
Invoke-Expression $Command
}
Export-ModuleMember -Alias Docker-Build -Function Docker-Build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment