Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
212ccdc
Doc improvements
cristianrgreco Jul 23, 2025
a9e22c9
More
cristianrgreco Jul 23, 2025
088e234
ArangoDB
cristianrgreco Jul 23, 2025
876d962
Azurite
cristianrgreco Jul 23, 2025
6fe748b
Cassandra
cristianrgreco Jul 23, 2025
4234eeb
ChromaDB
cristianrgreco Jul 24, 2025
e13c942
ClickHouse
cristianrgreco Jul 24, 2025
ba296aa
CockroachDB
cristianrgreco Jul 24, 2025
20bde37
CosmosDB
cristianrgreco Jul 24, 2025
19f4827
Couchbase
cristianrgreco Jul 25, 2025
5ad0eb6
Elasticsearch
cristianrgreco Jul 25, 2025
9ff3d83
Etcd
cristianrgreco Jul 25, 2025
38d80f0
wait-strategies touch ups
cristianrgreco Jul 25, 2025
c3900f8
gcloud WIP
cristianrgreco Jul 25, 2025
b0e0fb3
Fix await using
cristianrgreco Jul 25, 2025
78f01cf
Gcloud WIP
cristianrgreco Jul 25, 2025
cbc5601
Gcloud WIP
cristianrgreco Jul 25, 2025
a6bdcaa
Gcloud
cristianrgreco Jul 25, 2025
dfa1693
HiveMQ
cristianrgreco Jul 25, 2025
0e45373
K3s
cristianrgreco Jul 25, 2025
71dede1
Kafka
cristianrgreco Jul 25, 2025
4e6ac31
kurrentdb
cristianrgreco Jul 25, 2025
6fe9d69
Localstack
cristianrgreco Jul 25, 2025
972b45f
Mariadb
cristianrgreco Jul 25, 2025
ef0b805
Minio
cristianrgreco Jul 25, 2025
b7051f7
Mockserver
cristianrgreco Jul 28, 2025
080bf94
Mongodb
cristianrgreco Jul 28, 2025
d366dbc
Mssqlserver
cristianrgreco Jul 28, 2025
0e9fc5d
Mysql
cristianrgreco Jul 28, 2025
75c00c3
Nats
cristianrgreco Jul 28, 2025
392eb50
Fix
cristianrgreco Jul 28, 2025
a94467b
Neo4j
cristianrgreco Jul 28, 2025
3bcb124
Ollama
cristianrgreco Jul 30, 2025
c2ea084
Opensearch
cristianrgreco Jul 30, 2025
a4b1f34
Postgres
cristianrgreco Jul 31, 2025
afe03c8
Qdrant
cristianrgreco Jul 31, 2025
d10e91c
rabbitmq
cristianrgreco Jul 31, 2025
67eb244
Redis
cristianrgreco Jul 31, 2025
5bc56c4
Redpanda
cristianrgreco Jul 31, 2025
46552e1
Scylladb
cristianrgreco Jul 31, 2025
081d9c8
Selenium
cristianrgreco Jul 31, 2025
51be24f
Toxiproxy
cristianrgreco Aug 1, 2025
4d119e0
valkey
cristianrgreco Aug 1, 2025
8d4c199
vault
cristianrgreco Aug 1, 2025
6ecfa03
weaviate
cristianrgreco Aug 1, 2025
7c7cbf5
Attempt fix for redis/valkey tests
cristianrgreco Aug 1, 2025
943b07a
Fix k3s tests for podman
cristianrgreco Aug 1, 2025
b3bd805
Fix selenium container tests
cristianrgreco Aug 1, 2025
f8eeddb
Remove unused docs
cristianrgreco Aug 1, 2025
51d7f18
Pass with no tests (k3s suite empty for podman)
cristianrgreco Aug 1, 2025
a5cd595
Merge branch 'main' into docs-improvements
cristianrgreco Aug 1, 2025
410b05d
Update codeblock type
cristianrgreco Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Configuration of the Docker daemon:
Configuration of Testcontainers and its behaviours:

| Variable | Example | Description |
| ------------------------------------- | -------------------------- | -------------------------------------------- |
| ------------------------------------- |----------------------------| -------------------------------------------- |
| TESTCONTAINERS_HOST_OVERRIDE | tcp://docker:2375 | Docker's host on which ports are exposed |
| TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE | /var/run/docker.sock | Path to Docker's socket used by ryuk |
| TESTCONTAINERS_RYUK_PRIVILEGED | true | Run ryuk as a privileged container |
| TESTCONTAINERS_RYUK_DISABLED | true | Disable ryuk |
| TESTCONTAINERS_RYUK_PORT | 65515 | Set ryuk host port (not recommended) |
| TESTCONTAINERS_SSHD_PORT | 65515 | Set SSHd host port (not recommended) |
| TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX | mycompany.com/registry | Set default image registry |
| RYUK_CONTAINER_IMAGE | testcontainers/ryuk:0.11.0 | Custom image for ryuk |
| SSHD_CONTAINER_IMAGE | testcontainers/sshd:1.1.0 | Custom image for SSHd |
| RYUK_CONTAINER_IMAGE | testcontainers/ryuk:0.12.0 | Custom image for ryuk |
| SSHD_CONTAINER_IMAGE | testcontainers/sshd:1.3.0 | Custom image for SSHd |
| TESTCONTAINERS_REUSE_ENABLE | true | Enable reusable containers |
| TESTCONTAINERS_RYUK_VERBOSE | true | Sets RYUK_VERBOSE env var in ryuk container |
2 changes: 1 addition & 1 deletion docs/features/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Container Runtime Client

Testcontainers configures an underlying container runtime to perform its tasks. This runtime works automatically with several providers like Docker, Podman, Colima, Rancher Desktop and Testcontainers Desktop. There are too many usage examples to list here, but here are some common examples:
Testcontainers configures an underlying container runtime to perform its tasks. This runtime works automatically with several providers like Docker, Podman, Colima, Rancher Desktop and Testcontainers Desktop. There are too many usage examples to list here, but here are some common examples.

### Fetch container runtime information

Expand Down
38 changes: 19 additions & 19 deletions docs/features/compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Create and start a Docker Compose environment:

```javascript
```js
const { DockerComposeEnvironment } = require("testcontainers");

const composeFilePath = "/path/to/build-context";
Expand All @@ -15,7 +15,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

You can override by providing [multiple compose files](https://docs.docker.com/compose/extends/#multiple-compose-files):

```javascript
```js
const environment = await new DockerComposeEnvironment(
composeFilePath,
[
Expand All @@ -27,14 +27,14 @@ const environment = await new DockerComposeEnvironment(

Provide a list of service names to only start those services:

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.up(["redis-1", "postgres-1"]);
```

### With wait strategy

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withWaitStrategy("redis-1", Wait.forLogMessage("Ready to accept connections"))
.withWaitStrategy("postgres-1", Wait.forHealthCheck())
Expand All @@ -46,7 +46,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
By default Testcontainers uses the "listening ports" wait strategy for all containers. If you'd like to override
the default wait strategy for all services, you can do so:

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withDefaultWaitStrategy(Wait.forHealthCheck())
.up();
Expand All @@ -56,7 +56,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

Testcontainers will automatically pull an image if it doesn't exist. This is configurable:

```javascript
```js
const { DockerComposeEnvironment, PullPolicy } = require("testcontainers");

const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
Expand All @@ -66,7 +66,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

Create a custom pull policy:

```typescript
```ts
const { GenericContainer, ImagePullPolicy } = require("testcontainers");

class CustomPullPolicy implements ImagePullPolicy {
Expand All @@ -82,7 +82,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

### With rebuild

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withBuild()
.up();
Expand All @@ -92,7 +92,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

See [environment file](https://docs.docker.com/compose/environment-variables/#using-the---env-file--option).

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withEnvironmentFile(".env.custom")
.up();
Expand All @@ -102,15 +102,15 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

See [profiles](https://docs.docker.com/compose/profiles/).

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withProfiles("profile1", "profile2")
.up();
```

### With no recreate

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withNoRecreate()
.up();
Expand All @@ -126,7 +126,7 @@ services:
image: redis:${TAG}
```

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withEnvironment({ "TAG": "VALUE" })
.up();
Expand All @@ -136,7 +136,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

See [project name](https://docs.docker.com/compose/project-name/).

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withProjectName("test")
.up();
Expand All @@ -146,7 +146,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

See [docker-compose](https://github.com/PDMLab/docker-compose/) library.

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
.withClientOptions({ executable: { standalone: true, executablePath: "/path/to/docker-compose" } })
.up();
Expand All @@ -157,21 +157,21 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF

Testcontainers by default will not wait until the environment has downed. It will simply issue the down command and return immediately. This is to save time when running tests.

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
await environment.down();
```

If you need to wait for the environment to be downed, you can provide a timeout:

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
await environment.down({ timeout: 10_000 }); // 10 seconds
```

Volumes created by the environment are removed when stopped. This is configurable:

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
await environment.down({ removeVolumes: false });
```
Expand All @@ -180,7 +180,7 @@ await environment.down({ removeVolumes: false });

If you have multiple docker-compose environments which share dependencies such as networks, you can stop the environment instead of downing it:

```javascript
```js
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
await environment.stop();
```
Expand All @@ -189,6 +189,6 @@ await environment.stop();

Interact with the containers in your compose environment as you would any other Generic Container. Note that the container name suffix has changed from `_` to `-` between docker-compose v1 and v2 respectively.

```javascript
```js
const container = environment.getContainer("alpine-1");
```
Loading
Loading