Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update one-container image with new pihole images #252

Merged
merged 12 commits into from
Jan 12, 2025

Conversation

mpgirro
Copy link
Owner

@mpgirro mpgirro commented Sep 15, 2024

This PR adds automation to update the pihole image in the Dockerfile when new versions become available. It does so by:

  • Adding Renovate bot to update the version tag of Pihole in Dockerfile. You need to activate the Renovate App for this repository (it's free). Renovate normally opens PRs for manual review and approval. I've configured it to not open PRs for updates to the Dockerfile, but automatically commit all Docker tag updates without the need for manual interaction.

  • Adding a GitHub Actions workflow that builds and pushed the new images. This is only triggered when the Dockerfile is updated. The image gets tagged with the same version tag as the new pihole tag, as well as latest. New images get pushed to Docker Hub under your account, as well as GitHub Container Registry (GHCR) – simply because it's simply integrated to this repo.

Setup steps required to enable the new features

It's not sufficient to merge this PR. You need to do a few simple steps initially to enable the automation.

Activate the Renovate App for this repository. Afterwards, in the app settings at the bottom under "Repository access", add this repository so Renovate can start processing this repo. You will get an onboarding PR automatically if you do this before merging this PR. It's not necessary to merge this, since this PR already has the required renovate.json file.

Add a new variable for GitHub Actions called DOCKERHUB_USERNAME with your Docker Hub username.

Add a new secret for GitHub Actions called DOCKERHUB_TOKEN with an personal access token for Docker Hub. Generate the token here. The tokens needs "Read & Write" permissions.

@mpgirro
Copy link
Owner Author

mpgirro commented Sep 15, 2024

I've tested and verified that the automation works in my fork repo. It's already pushing new images automatically to Docker Hub and GHRC

@mpgirro
Copy link
Owner Author

mpgirro commented Sep 15, 2024

I've update the PR to automatically create a GitHub release in the same style as the history release notes (preview)

@mpgirro mpgirro force-pushed the main branch 3 times, most recently from 36a230f to e9a2169 Compare September 25, 2024 19:03
@mpgirro mpgirro force-pushed the main branch 3 times, most recently from f779d58 to 3170564 Compare September 26, 2024 08:28
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@chriscrowe
Copy link
Collaborator

I've actually been looking to hand this repo over to someone else for a while -- this implementation looks good. Are you interested in becoming the official repo for this project?

@mpgirro
Copy link
Owner Author

mpgirro commented Sep 30, 2024

Yes, I can take over this project.

How do you want to do this? Transfer the repository to me?

@BoBBer446
Copy link

Where is the dockerfile ?

@mpgirro
Copy link
Owner Author

mpgirro commented Nov 13, 2024

@BoBBer446 The Dockerfile is located at one-container/pihole-unbound/Dockerfile

@JAKAMI99 JAKAMI99 mentioned this pull request Dec 26, 2024
@blue-bean
Copy link

@mpgirro
Can you tell us something about the status of the repo transfer?

@mpgirro
Copy link
Owner Author

mpgirro commented Jan 12, 2025

Can you tell us something about the status of the repo transfer?

I haven't heard anything from @chriscrowe so far.

@chriscrowe
Copy link
Collaborator

I'll submit a repo transfer right now. We'll need to also figure out what to do with the Docker images

@chriscrowe
Copy link
Collaborator

mpgirro/docker-pihole-unbound already exists

Looks like you'll need to rename or delete that repo before I can transfer this.

@mpgirro
Copy link
Owner Author

mpgirro commented Jan 12, 2025

I've renamed my fork. Pls try again

@chriscrowe
Copy link
Collaborator

mpgirro already has a repository in the chriscrowe/docker-pihole-unbound network

😬

@mpgirro
Copy link
Owner Author

mpgirro commented Jan 12, 2025

Can you merge this PR? Then I can just delete my fork

@chriscrowe chriscrowe merged commit 99081df into mpgirro:main Jan 12, 2025
@mpgirro
Copy link
Owner Author

mpgirro commented Jan 12, 2025

My fork is deleted

@chriscrowe
Copy link
Collaborator

Transfer request sent

@blue-bean
Copy link

cool 👍

@JvdMaat
Copy link

JvdMaat commented Jan 14, 2025

Looks like this worked. Though my docker container hasn't noticed the new 2024.07.0 release since it's still pointing at https://hub.docker.com/r/cbcrowe/pihole-unbound
Is there anyway to push a release to that with a breaking change note that the repository has changed?
(Sadly I have had 2 other containers that changed docker hub locations, and I didn't find out until months later when I went through and checked on all my containers that hadn't updated in 6+ months).
I do religiously read release notes, but both of those just posted the change in the new location. Which is unhelpful.

@blue-bean
Copy link

I've manually changed my docker config in unraid pointing now to mpgirro/docker-pihole-unbound:latest - et voila.
I don't know another way...

@talondnb
Copy link

@mpgirro, it took me a while to find this thread. Any chance you could add a sticky at the top of the Issues section to steer others that might not be aware that you've taken over the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants