microsoft / azure-pipelines-tasks-common-packages

MIT License
26 stars 39 forks source link

AzDO Docker Task unable to add Base Image digest label #408

Open anumalasri opened 2 weeks ago

anumalasri commented 2 weeks ago

AzDO Docker tasks were unable to add base image digest, as task is looking for "RepoDigests" instead of 'Digest'.

https://github.com/microsoft/azure-pipelines-tasks-common-packages/blob/1a85babc3fcdfe52f2615247f0d088719d98037e/common-npm-packages/docker-common/containerimageutils.ts#L147C48-L147C59

Verified image available in docker hub and most of images have multiple RepoDigests. For example:

  "Id": "1b08278b118b0c1724bbdb78ad3ca04cea8c2675586b8ae3fb1f9088b69ec00d",
  "Digest": "sha256:a892d3aff561b7f1f49573d1536dda944c9c3133ad47ff76f95db7d529ed26a6",
  "RepoTags": [
       "docker.io/istio/proxyv2:1.24.0"
  ],
  "RepoDigests": [
       "docker.io/istio/proxyv2@sha256:a892d3aff561b7f1f49573d1536dda944c9c3133ad47ff76f95db7d529ed26a6",
       "docker.io/istio/proxyv2@sha256:ee6565e57319e01b5e45b929335eb9dc3d4b30d531b4652467e6939ae81b41f7"
  ],

Due to above reason, the task is skipping to add image.base.digest labe, but giving this message.

[debug]Multiple digests were found for image:

Is it possible to find appropriate base image Digest or default it to first one ?

ivanduplenskikh commented 2 weeks ago

Hi @anumalasri thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.