src/cmd-remote-build-container: use standard labels for git info
Colin pointed me at [1], which are some standard labels for this
kind of thing. Let's just use those instead.
Fixes:
[1]
@@ -125,16 +125,8 @@ def main():
shortcommit = commit[0:7]
logging.info(f"Translated {args.git_url}#{args.git_ref} into {shortcommit}")
# Add some information about the commit to labels for the container
- cmd = ["git", "-C", gitdir, "show", "--quiet",
- "FETCH_HEAD", "--pretty=format:%aN|%ad|%s"]
- gitinfo = runcmd(cmd, quiet=True, capture_output=True).stdout.strip().decode()
- gitauthor, gitdate, gittitle = gitinfo.split("|")
- args.labels.append(f"build.commit.id={commit}")
- args.labels.append(f"build.commit.ref={args.git_ref}")
- args.labels.append(f"build.commit.url={args.git_url}")
- args.labels.append(f"build.commit.author={gitauthor}")
- args.labels.append(f"build.commit.date={gitdate}")
- args.labels.append(f"build.commit.title={gittitle}")
+ args.labels.append(f"org.opencontainers.image.revision={commit}")
+ args.labels.append(f"org.opencontainers.image.source={args.git_url}")
# If a tag wasn't passed then use the arch + shortcommit
if not args.tag:
args.tag = f"{args.arch}-{shortcommit}"
