metanorma / metanorma-docker

Docker container for running the Metanorma toolchain
https://www.metanorma.com
5 stars 3 forks source link

Set `org.opencontainers.image` labels, reduce duplicated custom labels on container #139

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago

We used to add the following labels to the container because there wasn't a standardized way of tracing container provenance.

2022-03-16T21:22:18.0541555Z org.opencontainers.image.title=metanorma-docker
2022-03-16T21:22:18.0542628Z org.opencontainers.image.description=Docker container for running the Metanorma toolchain
2022-03-16T21:22:18.0544070Z org.opencontainers.image.url=https://github.com/metanorma/metanorma-docker
2022-03-16T21:22:18.0544814Z org.opencontainers.image.source=https://github.com/metanorma/metanorma-docker
2022-03-16T21:22:18.0545359Z org.opencontainers.image.version=latest
2022-03-16T21:22:18.0545958Z org.opencontainers.image.created=2022-03-16T21:22:18.048Z
2022-03-16T21:22:18.0546509Z org.opencontainers.image.revision=ed9590847a79b5d85c51cfa70e3681dbd60d4ef1
2022-03-16T21:22:18.0547006Z org.opencontainers.image.licenses=
2022-03-16T21:22:18.0547511Z metanorma-container-root=ruby
2022-03-16T21:22:18.0548138Z metanorma-container-source=https://github.com/metanorma/metanorma-docker
2022-03-16T21:22:18.0548758Z metanorma-container-remote=metanorma/mn:latest
2022-03-16T21:22:18.0549282Z metanorma-container-version=latest
2022-03-16T21:22:18.0549900Z metanorma-container-commit=ed9590847a79b5d85c51cfa70e3681dbd60d4ef1
2022-03-16T21:22:18.0550495Z metanorma-container-commit-branch=main

Now that there is the org.opencontainers.image way, we can remove the following labels:

metanorma-container-source=https://github.com/metanorma/metanorma-docker
metanorma-container-version=latest
metanorma-container-commit=ed9590847a79b5d85c51cfa70e3681dbd60d4ef1

We also should set the other allowed labels:

org.opencontainers.image.vendor => Ribose Inc.
org.opencontainers.image.licenses => `BSD-3-Clause`
org.opencontainers.image.version => version of metanorma-cli
org.opencontainers.image.documentation => https://www.metanorma.org
org.opencontainers.image.ref.name => replace `metanorma-container-remote`, use the image name, e.g. `metanorma/mn`
org.opencontainers.image.base.name => replace `metanorma-container-root`, use the base image name in full, i.e. `docker.io/library/ruby:3.1-slim-bullseye`
org.opencontainers.image.title => human-readable name of image, e.g. "Metanorma 1.1 official public image"
org.opencontainers.image.description => human-readable description of image, e.g. "Metanorma 1.1 official public image on ruby:3.1-slim-bullseye"
ronaldtse commented 2 years ago

Done in #145