You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'main' into fix/multiplexed_exec_output
* main:
bug:Fix AMQPS url (testcontainers#2462)
chore: more compose updates in comments
chore: use "docker compose" (v2) instead of "docker-compose" (v1) (testcontainers#2464)
chore(deps): bump github/codeql-action from 2.22.12 to 3.24.9 (testcontainers#2459)
Copy file name to clipboardExpand all lines: docs/features/docker_compose.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This is intended to be useful on projects where Docker Compose is already used
7
7
in dev or other environments to define services that an application may be
8
8
dependent upon.
9
9
10
-
## Using `docker-compose` directly
10
+
## Using `dockercompose` directly
11
11
12
12
!!!warning
13
13
The minimal version of Go required to use this module is **1.21**.
@@ -16,9 +16,9 @@ dependent upon.
16
16
go get github.com/testcontainers/testcontainers-go/modules/compose
17
17
```
18
18
19
-
Because `docker-compose` v2 is implemented in Go it's possible for _Testcontainers for Go_ to
19
+
Because `compose` v2 is implemented in Go it's possible for _Testcontainers for Go_ to
20
20
use [`github.com/docker/compose`](https://github.com/docker/compose) directly and skip any process execution/_docker-compose-in-a-container_ scenario.
21
-
The `ComposeStack` API exposes this variant of using `docker-compose` in an easy way.
21
+
The `ComposeStack` API exposes this variant of using `dockercompose` in an easy way.
To interact with service containers after a stack was started it is possible to get an `*tc.DockerContainer` instance via the `ServiceContainer(...)` function.
90
90
The function takes a **service name** (and a `context.Context`) and returns either a `*tc.DockerContainer` or an `error`.
91
-
This is different to the previous `LocalDockerCompose` API where service containers were accessed via their **container name** e.g. `mysql_1` or `mysql-1` (depending on the version of `docker-compose`).
91
+
This is different to the previous `LocalDockerCompose` API where service containers were accessed via their **container name** e.g. `mysql_1` or `mysql-1` (depending on the version of `dockercompose`).
92
92
93
93
Furthermore, there's the convenience function `Serices()` to get a list of all services **defined** by the current project.
94
94
Note that not all of them need necessarily be correctly started as the information is based on the given compose files.
95
95
96
96
### Wait strategies
97
97
98
-
Just like with regular test containers you can also apply wait strategies to `docker-compose` services.
98
+
Just like with regular test containers you can also apply wait strategies to `dockercompose` services.
99
99
The `ComposeStack.WaitForService(...)` function allows you to apply a wait strategy to **a service by name**.
100
100
All wait strategies are executed in parallel to both improve startup performance by not blocking too long and to fail
0 commit comments