1
0

fix: do not rebuild existing containers w/o files

This commit is contained in:
dump_stack() 2024-02-21 18:16:51 +00:00
parent 61b995f330
commit 451566d27f
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
5 changed files with 27 additions and 15 deletions

View File

@ -37,9 +37,12 @@ func (centos CentOS) Packages() (pkgs []string, err error) {
return
}
err = c.Build("centos:"+centos.release, centos.envs(), centos.runs())
if err != nil {
return
if !c.Exist() {
err = c.Build("centos:"+centos.release,
centos.envs(), centos.runs())
if err != nil {
return
}
}
cmd := "yum search kernel --showduplicates 2>/dev/null " +

View File

@ -54,9 +54,11 @@ func (d Debian) Packages() (packages []string, err error) {
return
}
err = c.Build(d.image(), d.envs(), d.runs())
if err != nil {
return
if !c.Exist() {
err = c.Build(d.image(), d.envs(), d.runs())
if err != nil {
return
}
}
kernels, err := GetKernels()

View File

@ -70,9 +70,11 @@ func (suse OpenSUSE) Packages() (pkgs []string, err error) {
name = "opensuse/leap:" + suse.release
}
err = c.Build(name, suse.envs(), suse.runs())
if err != nil {
return
if !c.Exist() {
err = c.Build(name, suse.envs(), suse.runs())
if err != nil {
return
}
}
cmd := "zypper search -s --match-exact kernel-default | grep x86_64 " +

View File

@ -38,9 +38,12 @@ func (ol OracleLinux) Packages() (pkgs []string, err error) {
return
}
err = c.Build("oraclelinux:"+ol.release, ol.envs(), ol.runs())
if err != nil {
return
if !c.Exist() {
err = c.Build("oraclelinux:"+ol.release,
ol.envs(), ol.runs())
if err != nil {
return
}
}
if ol.release == "8" {

View File

@ -42,9 +42,11 @@ func (u Ubuntu) Packages() (pkgs []string, err error) {
return
}
err = c.Build("ubuntu:"+u.release, u.envs(), u.runs())
if err != nil {
return
if !c.Exist() {
err = c.Build("ubuntu:"+u.release, u.envs(), u.runs())
if err != nil {
return
}
}
cmd := "apt-cache search " +