-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Bug]: library/mysql is not a valid substitute for mysql #5612
Comments
Hey @kernle32dll, thanks for reporting. You are right, I am not yet sure if we want to add a special case for |
Yeah. I think it comes down to a question of usability. One could argue that testcontainers should use images with |
All good, I think you have a point here. We just need to ponder if such a change will have other unintended sideffects and particularly, how well it will play with other Docker-API compatible container engines, that are not Docker (thinking of podman here). |
In a way, I think this is related to #5275 as well and should be tackled in conjunction. |
I would like to point out, that this issue is not specific for mysql, but for any(most?) fully-qualified names. [1]
|
@fedinskiy did the documentation solution as mentioned by the Podman team work for you? containers/podman#15306 (comment) |
I uncommented At the same time, I still think, that test-containers should consider |
I am not opposed to it in general, but I feel that instead of sprinkling the code with making As you can see in this issue, besides the |
Fixed via #6174 and it will be part of the next release. |
Module
MySQL
Testcontainers version
1.17.3
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host Arch
x86
Docker version
What happened?
We are using
new MySQLContainer<>("mysql:8.0.16")
to create a mysql container locally. All is working fine.However, in our CI we now introduced a Docker proxy via Nexus. Since we don't want to use the proxy locally, but only in the CI, we integrated it via an environment variable
TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry-proxy.awesomecorp.eu/"
.This did not work, as Nexus internally stores the mysql image not as
mysql
, butlibrary/mysql
(which is the same, e.g. you can dodocker pull library/mysql:latest
on your machine right now, and it will work). So we adjusted the code to:new MySQLContainer<>("library/mysql:8.0.16")
.But now the test fails at startup with
Failed to verify that image 'library/mysql:8.0.16' is a compatible substitute for 'mysql'.
. It provides theasCompatibleSubstituteFor
method for a fix, and that works. However, I would argue it should not be necessary, as its essentially the same image.Alas,
DockerImageName.parse("mysql:8.0.16").equal(DockerImageName.parse("library/mysql:8.0.16"))
should be true.Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: