* rework CI validation workflow and makefile * enable push * fix job names * fix license check * fix snapshot builds * fix acceptance tests * fix linting * disable pull request event * rework windows runner caching * disable release pipeline and add issue templates
30 lines
535 B
Go
30 lines
535 B
Go
//go:build linux || darwin
|
|
// +build linux darwin
|
|
|
|
package podman
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func buildImageFromCli(buildArgs []string) (string, error) {
|
|
iidfile, err := os.CreateTemp("/tmp", "dive.*.iid")
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
defer os.Remove(iidfile.Name())
|
|
|
|
allArgs := append([]string{"--iidfile", iidfile.Name()}, buildArgs...)
|
|
err = runPodmanCmd("build", allArgs...)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
imageId, err := os.ReadFile(iidfile.Name())
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return string(imageId), nil
|
|
}
|