replace "localhost/" prefix when searching for images to support Podman

This commit is contained in:
mrex 2025-05-09 22:08:46 +02:00 committed by GitHub
parent 7a6bac85b4
commit 32875ef65f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import (
"log" "log"
"os" "os"
"os/exec" "os/exec"
"regexp"
) )
var ( var (
@ -83,8 +84,10 @@ func dockerFindImage(repository, tag string) (*dockerImage, error) {
return nil, err return nil, err
} }
re := regexp.MustCompile("^localhost/")
for _, im := range images { for _, im := range images {
if im.Repository == repository && im.Tag == tag { if (im.Repository == repository || re.ReplaceAllString(im.Repository, "") == repository) && im.Tag == tag {
// found it // found it
return &im, nil return &im, nil
} }