feat(buildah): Output image digest to container terminated state message
@@ -231,6 +231,17 @@ func (t *builderTrait) buildahTask(e *Environment) (*v1.ImageTask, error) {
"docker://" + image,
}
+ digest := []string{
+ "buildah",
+ "images",
+ "--storage-driver=vfs",
+ "--format",
+ "'{{.Digest}}'",
+ image,
+ ">",
+ "/dev/termination-log",
+ }
+
if t.Verbose {
bud = append(bud[:2], append([]string{"--log-level=debug"}, bud[2:]...)...)
push = append(push[:2], append([]string{"--log-level=debug"}, push[2:]...)...)
@@ -250,7 +261,10 @@ func (t *builderTrait) buildahTask(e *Environment) (*v1.ImageTask, error) {
},
Image: fmt.Sprintf("quay.io/buildah/stable:v%s", defaults.BuildahVersion),
Command: []string{"/bin/sh", "-c"},
- Args: []string{strings.Join(bud, " ") + " && " + strings.Join(push, " ")},
+ Args: []string{
+ strings.Join(bud, " ") +
+ " && " + strings.Join(push, " ") +
+ " && " + strings.Join(digest, " ")},
Env: env,
WorkingDir: path.Join(builderDir, e.IntegrationKit.Name, "package", "context"),
},
