Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: incorrect Docker image labels #1770

Open
pl4nty opened this issue Apr 2, 2024 · 1 comment
Open

Bug report: incorrect Docker image labels #1770

pl4nty opened this issue Apr 2, 2024 · 1 comment
Labels

Comments

@pl4nty
Copy link

pl4nty commented Apr 2, 2024

Describe the bug
The Docker image manifest is inheriting labels from nginx, rather than the labels generated in CI

To Reproduce

  1. View the Docker image manifest on GHCR
  2. Compare to the CI labels

Expected behaviour
CI labels:

"labels": {
  "org.opencontainers.image.created": "2024-04-02T20:47:49.230Z",
  "org.opencontainers.image.description": "The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis",
  "org.opencontainers.image.licenses": "Apache-2.0",
  "org.opencontainers.image.revision": "c35557aea5204[62](https://github.com/gchq/CyberChef/actions/runs/8529184419/job/23364409016#step:9:70)28af7c545cf05337c6245e087",
  "org.opencontainers.image.source": "https://github.com/gchq/CyberChef",
  "org.opencontainers.image.title": "CyberChef",
  "org.opencontainers.image.url": "https://github.com/gchq/CyberChef",
  "org.opencontainers.image.version": "10"
}

Manifest labels:

"labels": {
  "org.opencontainers.image.url": "https://hub.docker.com/_/nginx",
  "org.opencontainers.image.source": "https://github.com/nginxinc/docker-nginx.git#1f227619c1f1baa0bed8bed844ea614437ff14fb:mainline/alpine",
  "org.opencontainers.image.revision": "1f227619c1f1baa0bed8bed844ea614437ff14fb",
  "org.opencontainers.image.created": "2024-02-14T18:24:57Z",
  "org.opencontainers.image.version": "1.25.4-alpine",
  "com.docker.official-images.bashbrew.arch": "amd64",
  "org.opencontainers.image.base.digest": "sha256:3bef9528bb5cea997fb7e0f106d2a4a6142cd0e8e8068f4cb54edc148b872fe7",
  "org.opencontainers.image.base.name": "nginx:1.25.4-alpine-slim"
}
@pl4nty pl4nty added the bug label Apr 2, 2024
@AshCorr
Copy link
Contributor

AshCorr commented Apr 8, 2024

Curious!

When inspecting the image with podman inspect ghcr.io/gchq/cyberchef:latest I see that the manifest has both a Labels and an Annotations attribute.

          "Labels": {
               "io.buildah.version": "1.23.1",
               "maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>",
               "org.opencontainers.image.created": "2024-04-05T17:27:58.780Z",
               "org.opencontainers.image.description": "The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis",
               "org.opencontainers.image.licenses": "Apache-2.0",
               "org.opencontainers.image.revision": "33a473c09b33360b03c76c2c01eec8c4b0adf714",
               "org.opencontainers.image.source": "https://github.com/gchq/CyberChef",
               "org.opencontainers.image.title": "CyberChef",
               "org.opencontainers.image.url": "https://github.com/gchq/CyberChef",
               "org.opencontainers.image.version": "10"
          },
          "Annotations": {
               "com.docker.official-images.bashbrew.arch": "amd64",
               "org.opencontainers.image.base.digest": "sha256:3bef9528bb5cea997fb7e0f106d2a4a6142cd0e8e8068f4cb54edc148b872fe7",
               "org.opencontainers.image.base.name": "nginx:1.25.4-alpine-slim",
               "org.opencontainers.image.created": "2024-02-14T18:24:57Z",
               "org.opencontainers.image.revision": "1f227619c1f1baa0bed8bed844ea614437ff14fb",
               "org.opencontainers.image.source": "https://github.com/nginxinc/docker-nginx.git#1f227619c1f1baa0bed8bed844ea614437ff14fb:mainline/alpine",
               "org.opencontainers.image.url": "https://hub.docker.com/_/nginx",
               "org.opencontainers.image.version": "1.25.4-alpine"
          },

I think the problem is that the buildah-build action we use to build the image is applying the org.opencontainers metadata to Labels attribute instead of Annotations (where Github and other tools expect this metadata to be). I've raised a PR to add support for annotations to buildah-build here, once thats merged we can fix the CI in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants