google / go-containerregistry

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

crane: GCR images are not up to date #1877

Open matthew-muscat opened 8 months ago

matthew-muscat commented 8 months ago

Describe the bug

Crane docker images that are intended to be available at gcr.io/go-containerregistry/crane[version] and gcr.io/go-containerregistry/crane/debug:[version] are not currently up to date.

It would appear the most recent docker container release for the GCR registry is August 2023

The docker images are documented as being available via the GCR registry over at https://github.com/google/go-containerregistry/blob/8dadbe76ff8c20d0e509406f04b7eade43baa6c1/cmd/crane/README.md#images

To Reproduce

  1. Run the command docker run -it gcr.io/go-containerregistry/crane/debug:v0.19.0
  2. Observe the image not being pulled, as it does not exist

Or

  1. Navigate to gcr.io/go-containerregistry/crane/debug
  2. Sort the images by created date
  3. Observe the most recent image as occurring on 1st August, 2023

Expected behavior

Crane Images should be published to the GCR registries for each release

matthew-muscat commented 8 months ago

Looks like this has been occurring for all releases from v0.16+

https://github.com/google/go-containerregistry/issues/1851 https://github.com/google/go-containerregistry/issues/1772

jonjohnsonjr commented 5 months ago

Almost certainly the CI/CD setup that publishes those images has bitrotted since I left Google, and I no longer have access to the GCP project that hosts the cloud build setup, sorry :/

Most of the people who used to maintain this repo now work at Chainguard, where we package a lot of open source software, including crane: https://cgr.dev/chainguard/crane

(I really don't mean for this to sound like a sales pitch.)

Downside here is that only the latest version is provided for free, but if you're okay with only the latest release, consider switching to that (and I recommend digestabot to control the updates).

If someone wants to migrate cloudbuild.yaml to GitHub Actions pushing to ghcr.io, I'd happily approve that as well. Maybe leave the existing cloudbuild.yaml in case someone with access wants to fix it.

github-actions[bot] commented 2 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.

Jasper-Ben commented 2 months ago

If someone wants to migrate cloudbuild.yaml to GitHub Actions pushing to ghcr.io, I'd happily approve that as well.

I might give it a shot, unless someone is already working on this?

Jasper-Ben commented 2 months ago

@jonjohnsonjr I created a PR that should fix this and build & push container images to the ghcr during release. Only issue I am currently running into is that the container does not seem to pick up on the version:

$ docker run --rm ghcr.io/jasper-ben/go-containerregistry/crane version
(devel)

However, at least with the package installed from the arch package repository that is also the case. Could this be an unrelated issue?

jonjohnsonjr commented 2 months ago

Hm that's a little weird -- does it work if you try to use the Commit?

Jasper-Ben commented 2 months ago

Hm that's a little weird -- does it work if you try to use the Commit?

Tried that as well to no avail. I also checked the prebuilt binaries from the release page. They are returning the correct version 🤔

I am not too familiar with ko, but I think I used it correct here? ...

Jasper-Ben commented 2 months ago

The defaultBaseImage: gcr.io/distroless/base:debug setting in the debug image is picked up though, so the config is used during the build process:

$ docker run -it --rm --entrypoint=/busybox/sh ghcr.io/jasper-ben/go-containerregistry/crane:debug
/ #

Looking at the docs again, I think I might be using the builds config incorrect, i.e. maybe something with the path, causing the builds section not to be picked up. Not 100% sure though, will check tomorrow.