Test image with multiple tags from metadata-action
See original GitHub issueThere’s an example on how to load and test an image with a fixed tag: https://github.com/docker/build-push-action/blob/master/docs/advanced/test-before-push.md. But I’m using metadata-action to potentially build and push images with multiple tags, thus just trying to run ${{ steps.meta.outputs.tags }}
won’t work.
Previously I didn’t use gha cache and then ${{ steps.build.outputs.digest }}
seemed to work for docker run
. But since adding caching (and thus docker/setup-buildx-action
), this doesn’t work anymore:
docker: Error response from daemon: No such image: sha256:6507963a29515198ef9813243ad16cd47e864a05594682b66e0de32fbc9196e2.
I guess it’s somehow related to #461, but I don’t really care what digest is what and where it’s shown. I just want to run the loaded image.
I also tried ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build.outputs.digest }}
, but that doesn’t work for running the locally loaded image either:
Unable to find image 'ghcr.io/goblint/analyzer@sha256:53a5a659327deceb4ea5f1a9e89d6648cd8069d2b5bc59d7b75d1199987fd768' locally
How is this supposed to be done?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Thanks! This is what I was looking for. Maybe it would be useful for others to have this mentioned in the test-before-push example document as well.
@sim642 Don’t really get your point of using the metadata action in the step that exports the image to docker to be able to test it but you can use the
${{ steps.meta.outputs.version }}
output:Or the JSON output from the metadata action:
Or the metadata output of this action: