@@ -14,6 +14,7 @@ import (
1414 "github.com/function61/gokit/os/osutil"
1515 "github.com/function61/turbobob/pkg/bobfile"
1616 "github.com/function61/turbobob/pkg/versioncontrol"
17+ ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
1718 "github.com/spf13/cobra"
1819)
1920
@@ -165,18 +166,18 @@ func buildAndPushOneDockerImage(dockerImage bobfile.DockerImageSpec, buildCtx *B
165166 annotationsKeyValues = append (annotationsKeyValues , fmt .Sprintf ("%s=%s" , key , value ))
166167 }
167168
168- annotate ("org.opencontainers.image.title" , buildCtx .Bobfile .ProjectName )
169- annotate ("org.opencontainers.image.created" , time .Now ().UTC ().Format (time .RFC3339 ))
170- annotate ("org.opencontainers.image.revision" , buildCtx .RevisionId .RevisionId )
171- annotate ("org.opencontainers.image.version" , buildCtx .RevisionId .FriendlyRevisionId )
172- annotate ("org.opencontainers.image.description" , buildCtx .Bobfile .Meta .Description )
169+ annotate (ociv1 . AnnotationTitle , buildCtx .Bobfile .ProjectName )
170+ annotate (ociv1 . AnnotationCreated , time .Now ().UTC ().Format (time .RFC3339 ))
171+ annotate (ociv1 . AnnotationRevision , buildCtx .RevisionId .RevisionId )
172+ annotate (ociv1 . AnnotationVersion , buildCtx .RevisionId .FriendlyRevisionId )
173+ annotate (ociv1 . AnnotationDescription , buildCtx .Bobfile .Meta .Description )
173174
174175 // "URL to get source code for building the image"
175- annotate ("org.opencontainers.image.source" , buildCtx .RepositoryURL )
176+ annotate (ociv1 . AnnotationSource , buildCtx .RepositoryURL )
176177 // "URL to find more information on the image"
177- annotate ("org.opencontainers.image.url" , firstNonEmpty (buildCtx .Bobfile .Meta .Website , buildCtx .RepositoryURL ))
178+ annotate (ociv1 . AnnotationURL , firstNonEmpty (buildCtx .Bobfile .Meta .Website , buildCtx .RepositoryURL ))
178179 // "URL to get documentation on the image"
179- annotate ("org.opencontainers.image.documentation" , firstNonEmpty (buildCtx .Bobfile .Meta .Documentation , buildCtx .RepositoryURL ))
180+ annotate (ociv1 . AnnotationDocumentation , firstNonEmpty (buildCtx .Bobfile .Meta .Documentation , buildCtx .RepositoryURL ))
180181
181182 // "" => "."
182183 // "Dockerfile" => "."
0 commit comments