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

DockerHub Tags Are Out Of Sync With Source Repo #15

Open
the-wondersmith opened this issue Nov 25, 2024 · 8 comments
Open

DockerHub Tags Are Out Of Sync With Source Repo #15

the-wondersmith opened this issue Nov 25, 2024 · 8 comments

Comments

@the-wondersmith
Copy link

While working on some improvements for the testcontainers-rs crate, I noticed several unit tests absolutely refused to pass on my local machine. I eventually tracked the issue down to an architecture mismatch for the testcontainers/helloworld image.

The tl;dr is:

Image

Image

Image

It would appear that something might be up with the build bot?

I'm able to do a sort of partial mitigation in the testcontainers-rs test suite by replacing instances of

GenericImage::new("testcontainers/helloworld", "1.1.0")

with

GenericImage::new("testcontainers/helloworld", std::env::var("TESTCONTAINERS_HELLO_WORLD_TAG").as_deref().unwrap_or("1.1.0"))

But it seems like it'd be a much better idea to ensure that the latest tag is actually in sync with the git repo, then change the test suite to target the latest tag instead of hard coding 1.1.0. (Or possibly to just use the same env var override I did 🤔. Something to be discussed in that repo I suppose 😅)

In either case, would it be possible to get the multi-arch images / latest tag synced up?

@the-wondersmith
Copy link
Author

Just tagging @rnorth @mdelapenya @gesellix @kiview to bump this and see if we can't get some traction here 🙂

@mdelapenya
Copy link
Member

Mmm I think we need a release for the project. On it

@mdelapenya
Copy link
Member

@the-wondersmith the build is running: https://github.com/testcontainers/helloworld/actions/runs/12295845594 🤞

@the-wondersmith
Copy link
Author

@mdelapenya

Good news: looks like the build was successful 🎉

Image

Bad news: looks like latest is still out of sync 🥲

Image

@mdelapenya
Copy link
Member

I think it's because we are on-purposely not updating the latest tag 🤔 There are reasons for that regarding not allowing users consume "latest" and eventually cause unexpected errors

@the-wondersmith
Copy link
Author

I think it's because we are on-purposely not updating the latest tag 🤔 There are reasons for that regarding not allowing users consume "latest" and eventually cause unexpected errors

Ah. Well... I've taken the liberty of opening a PR that fixes it, if there's interest in it. If that's not the desired behavior though, maybe it'd be a better idea to remove the latest tag from the image repo entirely (so it doesn't mislead users and eventually cause unexpected errors in a different way)? 🤔

@gesellix
Copy link
Contributor

gesellix commented Dec 13, 2024

... it'd be a better idea to remove the latest tag from the image repo entirely

I think this would be the best, but I'm not sure if an existing tag can be removed completely. An option would be to push an intentionally invalid image with the latest tag. It could even print a message indicating that the latest tag should not be used, along with a link to the project's README.

Keeping the latest tag up-to-date is still a valid option, it's just not recommended. :)

@the-wondersmith
Copy link
Author

the-wondersmith commented Dec 14, 2024

@gesellix Did a bit of cursory digging, found a pretty decent write-up of deleting a single tag from an image repo. The tl;dr is that the tool of choice appears to be regclient (specifically, its regctl component). As long as you've got push access to the testcontainers docker hub, this ought to do it 😁:

regctl tag rm docker.io/testcontainers/helloworld:latest

You should be able to verify with:

regctl tag ls docker.io/testcontainers/helloworld

For the sake of completeness, I did test it myself with one of my own repos, and it does indeed surgically delete the specified tag. The DockerHub website appears to lag a bit behind though, so it'll still show there for a bit even though it will no longer resolve as a valid tag if you do something like docker pull docker.io/testcontainers/helloworld:latest.

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

No branches or pull requests

3 participants