mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers
MIT License
4.34k stars 388 forks source link

[Question] Release docker image to GHCR #1015

Closed ToshY closed 1 day ago

ToshY commented 5 days ago

Hello 👋

Is it possible to release the docker image to the GitHub Container Registry (GHCR) as well? Reason for asking: Docker Hub rate limits

Thanks in advance.

mlocati commented 1 day ago

Sure it's possible, provided one can tell me how to integrate it in this step.

ToshY commented 1 day ago

Sure it's possible, provided one can tell me how to integrate it in this step.

With the current docker/build-push-action and without changing much of your current implementation, I think the easiest way would be like this example: https://docs.docker.com/build/ci/github-actions/push-multi-registries/

In short, an additional login with docker/login-action@v3 and add ghcr.io/mlocati/php-extension-installer to the tags of the docker/build-push-action. (sidenote: you do not have to add additional secrets for this, the GITHUB_TOKEN secret is already available in the workflow)

I can create the PR if you'd like.

mlocati commented 1 day ago

Done, thanks for the link!

mlocati commented 1 day ago

Now the most important question (I'm kidding, of course😉): do you know if a badge like this is available for pulls from the GitHub Container Registry?

Docker Hub pulls

ToshY commented 11 hours ago

Now the most important question (I'm kidding, of course😉): do you know if a badge like this is available for pulls from the GitHub Container Registry?

Docker Hub pulls

Sadly doesn't seem an "easy" one that you can use like that one (also see https://github.com/badges/shields/issues/5594). Haven't test it myself, but there's one that includes "downloads", so you might be able to try to use https://github.com/ipitio/backage.

For other (non-downloads) badges, maybe this: https://github.com/eggplants/ghcr-badge

Tags

Latest

Size


Thanks for adding it to GHCR 👍

mlocati commented 10 hours ago

I ended up creating https://github.com/mlocati/docker-php-extension-installer/blob/master/.github/workflows/update-ghcr-badge.yml

ToshY commented 3 hours ago

I ended up creating https://github.com/mlocati/docker-php-extension-installer/blob/master/.github/workflows/update-ghcr-badge.yml

Hmm... If I understand correctly this will update your README with a new badge every day. While I find the approach interesting, will this not clutter your git history with Update GitHub Registry badge commits?

mlocati commented 3 hours ago

That action doesn't update the readme, just this branch: https://github.com/mlocati/docker-php-extension-installer/tree/assets

ToshY commented 3 hours ago

Oh I misunderstood then, thanks for clarifying. 👍