|
2 | 2 |
|
3 | 3 | ## Benefits |
4 | 4 |
|
5 | | -Similar to generic container support, it's also possible to run a bespoke set of services specified in a `docker-compose.yml` file. |
| 5 | +Similar to generic container support, it's also possible to run a bespoke set of services specified in a |
| 6 | +`docker-compose.yml` file. |
6 | 7 |
|
7 | 8 | This is especially useful for projects where Docker Compose is already used in development |
8 | 9 | or other environments to define services that an application may be dependent upon. |
@@ -34,12 +35,12 @@ services: |
34 | 35 | Note that it is not necessary to define ports to be exposed in the YAML file, |
35 | 36 | as this would inhibit the reuse/inclusion of the file in other contexts. |
36 | 37 |
|
37 | | -Instead, Testcontainers will spin up a small 'ambassador' container, |
| 38 | +Instead, Testcontainers will spin up a small `ambassador` container, |
38 | 39 | which will proxy between the Compose-managed containers and ports that are accessible to our tests. |
39 | 40 |
|
40 | 41 | ## ComposeContainer vs DockerComposeContainer |
41 | 42 |
|
42 | | -So far, we discussed `ComposeContainer`, which is the equivalent of docker compose [version 2](https://www.docker.com/blog/announcing-compose-v2-general-availability/). |
| 43 | +So far, we discussed `ComposeContainer`, which supports docker compose [version 2](https://www.docker.com/blog/announcing-compose-v2-general-availability/). |
43 | 44 |
|
44 | 45 | On the other hand, `DockerComposeContainer` utilizes Compose V1, which has been marked deprecated by Docker. |
45 | 46 |
|
@@ -83,9 +84,7 @@ while our db service waits for a specific log message: |
83 | 84 | [Wait for a custom command and a log message](../../core/src/test/java/org/testcontainers/junit/ComposeContainerWithWaitStrategies.java) inside_block:composeContainerWithCombinedWaitStrategies |
84 | 85 | <!--/codeinclude--> |
85 | 86 |
|
86 | | -!!! More on Wait Strategies |
87 | 87 |
|
88 | | - Refer to the documentation to learn how to use the API to create tailor-made strategies for [waiting until containers are fully started and ready](../features/startup_and_waits.md). |
89 | 88 |
|
90 | 89 | ## The 'Local Compose' Mode |
91 | 90 |
|
@@ -113,12 +112,11 @@ We can use file and directory references. |
113 | 112 | They are always resolved relative to the directory where the compose file resides. |
114 | 113 |
|
115 | 114 | !!! note |
116 | | - |
117 | 115 | This can be used with `DockerComposeContainer` and `ComposeContainer`, but **only in the containerized Compose (not with `Local Compose` mode)**. |
118 | 116 |
|
119 | 117 | ## Using private repositories in Docker compose |
120 | | -When Docker Compose is used in container mode (not local), |
121 | | -it needs to be made aware of Docker settings for private repositories. |
| 118 | +When Docker Compose is used in container mode (not local), it needs to be made aware of Docker |
| 119 | +settings for private repositories. |
122 | 120 | By default, those setting are located in `$HOME/.docker/config.json`. |
123 | 121 |
|
124 | 122 | There are 3 ways to specify location of the `config.json` for Docker Compose: |
|
0 commit comments