Initial Commit

This commit is contained in:
2024-11-12 19:20:37 +13:00
commit 7a0fda9889
6 changed files with 71 additions and 0 deletions

25
Build.ps1 Normal file
View File

@@ -0,0 +1,25 @@
$dockerfilesDirectory = "images"
$baseFilePath = "base.txt"
$baseImageLines = Get-Content -Path $baseFilePath
foreach ($file in Get-ChildItem -Path $dockerfilesDirectory -File) {
$dockerfilePath = $file.FullName
$dockerfileName = $file.Name
Write-Host "Processing Dockerfile: $dockerfilePath"
foreach ($baseImage in $baseImageLines) {
$name = $dockerfileName.SubString(0, $dockerfileName.IndexOf("."))
$buildArgs = "--build-arg BASE_IMAGE=$baseImage"
$dockerImageName = "git.119.224.65.18.sslip.io/siteorg/action-image-" + $name + ":$($baseImage.Replace('/', '_').Replace(':', '_'))"
Write-Host "Building image $dockerImageName"
$buildCommand = "docker build -f $dockerfilePath $buildArgs -t $dockerImageName ."
Invoke-Expression $buildCommand
Write-Host "Publishing image: $dockerImageName"
$pushCommand = "docker push $dockerImageName"
Invoke-Expression $pushCommand
}
}