Skip to content

Set image labels based on repository info#79

Open
RaphvK wants to merge 8 commits into
ika-rwth-aachen:mainfrom
RaphvK:improved-labels
Open

Set image labels based on repository info#79
RaphvK wants to merge 8 commits into
ika-rwth-aachen:mainfrom
RaphvK:improved-labels

Conversation

@RaphvK
Copy link
Copy Markdown
Member

@RaphvK RaphvK commented May 19, 2026

Closes #64

Currently, all images created in the docker-ros workflow inherit the following image labels from the base image (when used with default docker-ros-ml-images):

{
"maintainer":"Institute for Automotive Engineering (ika), RWTH Aachen University <opensource@ika.rwth-aachen.de>",
"org.opencontainers.image.authors":"Institute for Automotive Engineering (ika), RWTH Aachen University <opensource@ika.rwth-aachen.de>",
"org.opencontainers.image.licenses":"MIT",
"org.opencontainers.image.url":"https://github.com/ika-rwth-aachen/docker-ros-ml-images",
"org.opencontainers.image.version":"26.04"
}

This PR extends the build scripts and Dockerfile so that the following labels are overridden:

  • "maintainer": overridden with empty string by default
  • "org.opencontainers.image.authors": overridden with empty string by default
  • "org.opencontainers.image.licenses": taken from LICENSE file in root of repository if present, empty string otherwise
  • "org.opencontainers.image.url": URL of git repository if the build command is run from a git repo, empty string otherwise
  • "org.opencontainers.image.version": Git commit hash or tag if run in a git repo or tag pipeline, empty string otherwise

All values can be overriden using CI environment variables.

Tests

@RaphvK RaphvK mentioned this pull request May 19, 2026
@RaphvK
Copy link
Copy Markdown
Member Author

RaphvK commented May 19, 2026

As discussed with @lreiher and @jpbusch:

  • get url and version from repo metainfo
  • do not parse package.xml as this might lead to errors.
  • get license from LICENSE file in repo root
  • allow setting maintainer and authors via ci environment variables, unset as default
  • add one extra label to identify image as docker-ros image: "de.rwth-aachen.ika.docker-ros": "true"

@RaphvK RaphvK marked this pull request as ready for review May 19, 2026 15:42
@RaphvK
Copy link
Copy Markdown
Member Author

RaphvK commented May 19, 2026

As discussed with @lreiher and @jpbusch:

* get url and version from repo metainfo

* do not parse `package.xml` as this might lead to errors.

* get license from `LICENSE` file in repo root

* allow setting maintainer and authors via ci environment variables, unset as default

* add one extra label to identify image as docker-ros image: `"de.rwth-aachen.ika.docker-ros": "true"`

Changes implemented as discussed and ready for review @lreiher @jpbusch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Docker LABELs

1 participant