-
-
Notifications
You must be signed in to change notification settings - Fork 585
Description
Testcontainers version
v0.39.0
Using the latest Testcontainers version?
Yes
Host OS
MacOS
Host arch
ARM
Go version
1.25
Docker version
28.3.2Docker info
Client:
Version: 28.3.2
Context: desktop-linux
Server:
Server Version: 28.3.2What happened?
Docker CLI and testcontainers-go expect different formats of DOCKER_AUTH_CONFIG env variable, which seems unintended and misleading. The same DOCKER_AUTH_CONFIG that works with Docker CLI fails with testcontainers-go, and vice versa. It leads to auth problems that are hard to debug, taking into account there is little documentation on this env variable on both sides.
I've written a repro repository so there is a way to verify this issue.
Particular formats description
-
Docker CLI only accepts base64-encoded
"auth"field inside the"registry". See code and pull request. All other fields are disallowed and will result in an error. Example:{ "auths": { "registry": { "auth": "base64(username:password)" } } }The base64-encoded
"auth"is then parsed into"username"and"password"fields internally. -
testcontainers-go expects
"username"and"password"fields, it unmarshalsDOCKER_AUTH_CONFIGdirectly intodockercfg.Config, see code. Example:{ "auths": { "registry": { "username": "user", "password": "pass" } } }It supports
"auth"field, but does not parse it into"username"and"password", so Docker login fails with just"auth"field.
Relevant log output
Additional information
No response