From 39008c539c0230cd99da3a9c5f80f8f7f885cea1 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 23 Oct 2023 15:50:34 +0200 Subject: [PATCH] align with OCI artifact best practices Signed-off-by: Nicolas De Loof --- pkg/compose/publish.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/compose/publish.go b/pkg/compose/publish.go index 71efbef3..47b50814 100644 --- a/pkg/compose/publish.go +++ b/pkg/compose/publish.go @@ -20,6 +20,8 @@ import ( "context" "encoding/json" "os" + "path/filepath" + "time" "github.com/compose-spec/compose-go/types" "github.com/distribution/reference" @@ -72,6 +74,7 @@ func (s *composeService) publish(ctx context.Context, project *types.Project, re Size: int64(len(f)), Annotations: map[string]string{ "com.docker.compose.version": api.ComposeVersion, + "com.docker.compose.file": filepath.Base(file), }, } layers = append(layers, layer) @@ -114,6 +117,9 @@ func (s *composeService) publish(ctx context.Context, project *types.Project, re ArtifactType: "application/vnd.docker.compose.project", Config: configDescriptor, Layers: layers, + Annotations: map[string]string{ + "org.opencontainers.image.created": time.Now().Format(time.RFC3339), + }, }) if err != nil { return err