Created
October 17, 2020 02:50
-
-
Save phillipsj/23bc62fc3e5eb7d0aa24d88829846b5f to your computer and use it in GitHub Desktop.
Building our backup containers
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
if ((Get-ChildItem -Recurse -Path **\\Dockerfile).Count -gt 0) { | |
$dockerFiles = Get-ChildItem -Recurse -Path **\\Dockerfile | Select-Object -ExpandProperty DirectoryName -Unique | |
$dockerFiles | ForEach-Object { | |
Push-Location $_; | |
$directory = Get-Item Dockerfile | Select-Object -ExpandProperty Directory | |
docker build -t $directory.Name . | |
Pop-Location; | |
} | |
} | |
else { | |
Write-Host "No Dockerfiles found!" | |
exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment