#TestContainers with private registries

1 messages · Page 1 of 1 (latest)

ionic spade
#

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?

cold pendant
ionic spade
#

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?

cold pendant
#

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

ionic spade
#

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! 🙏