google / go-containerregistry

Go library and CLIs for working with container registries
Apache License 2.0
3.13k stars 542 forks source link

question: Add tag in `crane digest …` result #1804

Open davinkevin opened 1 year ago

davinkevin commented 1 year ago

Hello, I ask a question, but it's more a feature request than anything else. 😇

First, thank you for crane, it's a very good tool I use everyday 👏

As a user, I use it to get the last digest for every image I use in my system. And for readability and simplicity, we keep the full format, like described below:

FROM bellsoft/liberica-openjdk-alpine:17.0.8.1-1@sha256:9bed3e107e111266097f7bee14d73f810f192848fb4176132825d5c41d38c870

This format allows anyone to understand which tag has been used for sha extraction. For standard image, it's good, but it's even better for distroless images, because the tag is not used for version but for feature:

FROM gcr.io/distroless/base-debian12:debug-nonroot@sha256:9547fb931250e8939e4dff83ed07ef5e8012c56aa65c95f509005d84f55b24b9

So it's important to keep the debug-nonroot information, for the next update.

In crane digest command, even with the --full-ref parameter, we loose this tag information:

$ crane digest gcr.io/distroless/base-debian12:debug-nonroot --full-ref
gcr.io/distroless/base-debian12@sha256:0cbc35da706a70b83a9fe1ab8392b9b9b84ef91bb8c5fbaf965fa50d2c1b4126

Having a result structured with the tag would be better for our use case.

Thank you

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

davinkevin commented 10 months ago

Up?

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

davinkevin commented 7 months ago

up²

github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

davinkevin commented 4 months ago

up³

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

davinkevin commented 1 month ago

up⁴