@@ -53,3 +53,44 @@ String redisUrl = environment.getServiceHost("redis_1", REDIS_PORT)
5353 + ":" +
5454 environment.getServicePort("redis_1", REDIS_PORT);
5555` ` `
56+
57+ # # Using private repositories in Docker compose
58+ When Docker Compose is used in container mode (not local), it's needs to be made aware of Docker settings for private repositories.
59+ By default, those setting are located in `$HOME/.docker/config.json`.
60+
61+ There are 3 ways to specify location of the `config.json` for Docker Compose
62+ * Use `DOCKER_CONFIG_FILE` environment variable.
63+
64+ ` export DOCKER_CONFIG_FILE=/some/location/config.json`
65+
66+ * Use `dockerConfigFile` java property
67+
68+ ` java -DdockerConfigFile=/some/location/config.json`
69+
70+ * Don't specify anything, in this case default location `$HOME/.docker/config.json`, if present, will be used
71+
72+ # ###Note to OSX users
73+ By default, Docker for mac uses Keychain to store private repositories' keys. So, your `config.json` looks like
74+ ` ` ` $json
75+ {
76+ "auths" : {
77+ "https://index.docker.io/v1/" : {
78+ }
79+ },
80+ "credsStore" : "osxkeychain"
81+ }
82+ ` ` `
83+
84+ Docker Compose in container cannot access the Keychain, thus making the configuration useless.
85+ To work around this problem, create `config.json` in separate location with real authentication keys, like
86+ ` ` ` $json
87+ {
88+ "auths" : {
89+ "https://index.docker.io/v1/" : {
90+ "auth": "QWEADSZXC..."
91+ }
92+ },
93+ "credsStore" : "osxkeychain"
94+ }
95+ ` ` `
96+ and specify the location to TestContainers using any of the two first methods from above.
0 commit comments