Hi guys,
we are currently studying a way to migrate a lot of projects that use testcontainers to Dagger with minimum changes.
Some of these projects spin up a container based on an image stored on a private registry of ours that require authentication.
We played with vito's testcontainers module from the Daggerverse, but found no clear way of passing the credentials required by the registry.
The Docker daemon keeps logging the same message: "DockerApiException : Docker API responded with status code=InternalServerError, response={"message":"unauthorized: The client does not have permission for manifest"}"
Spinning up a container based on a public image works as intended though.
Has someone already achieved this in a way or another?
#TestContainers with private registries
1 messages · Page 1 of 1 (latest)
hey Fabrice! since the client is the one that passes the credentials to the docker engine, you need to find a way to pass your registry API token to your pipeline and populate the corresponding ~/.docker/config.json file which is the one being used by the docker CLI / SDKs to read the registry creds
Hello Marcos, thanks for your answer!
I was thinking about something like this, using the provided credentials to build a config.json on the fly inside the Docker container, is it what you suggest?
yep, exactly
the credentials shouldn't go in the Docker container, they should go wherever you're running testcontainers in
since I'd assume is testcontainers the one that actually has to use that file and pass it to the engine in the API calls
Thank you so much for that last part Marcos, I was stubbornly trying to create the config.json file inside the Docker container instead of the container running the tests! 🙏