Skip to content

Commit 74a5946

Browse files
Documentation improvements (#1089)
1 parent 40829ec commit 74a5946

File tree

102 files changed

+1828
-1881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1828
-1881
lines changed

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ Configuration of the Docker daemon:
3333
Configuration of Testcontainers and its behaviours:
3434

3535
| Variable | Example | Description |
36-
| ------------------------------------- | -------------------------- | -------------------------------------------- |
36+
| ------------------------------------- |----------------------------| -------------------------------------------- |
3737
| TESTCONTAINERS_HOST_OVERRIDE | tcp://docker:2375 | Docker's host on which ports are exposed |
3838
| TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE | /var/run/docker.sock | Path to Docker's socket used by ryuk |
3939
| TESTCONTAINERS_RYUK_PRIVILEGED | true | Run ryuk as a privileged container |
4040
| TESTCONTAINERS_RYUK_DISABLED | true | Disable ryuk |
4141
| TESTCONTAINERS_RYUK_PORT | 65515 | Set ryuk host port (not recommended) |
4242
| TESTCONTAINERS_SSHD_PORT | 65515 | Set SSHd host port (not recommended) |
4343
| TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX | mycompany.com/registry | Set default image registry |
44-
| RYUK_CONTAINER_IMAGE | testcontainers/ryuk:0.11.0 | Custom image for ryuk |
45-
| SSHD_CONTAINER_IMAGE | testcontainers/sshd:1.1.0 | Custom image for SSHd |
44+
| RYUK_CONTAINER_IMAGE | testcontainers/ryuk:0.12.0 | Custom image for ryuk |
45+
| SSHD_CONTAINER_IMAGE | testcontainers/sshd:1.3.0 | Custom image for SSHd |
4646
| TESTCONTAINERS_REUSE_ENABLE | true | Enable reusable containers |
4747
| TESTCONTAINERS_RYUK_VERBOSE | true | Sets RYUK_VERBOSE env var in ryuk container |

docs/features/advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Container Runtime Client
44

5-
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:
5+
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.
66

77
### Fetch container runtime information
88

docs/features/compose.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Create and start a Docker Compose environment:
66

7-
```javascript
7+
```js
88
const { DockerComposeEnvironment } = require("testcontainers");
99

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

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

18-
```javascript
18+
```js
1919
const environment = await new DockerComposeEnvironment(
2020
composeFilePath,
2121
[
@@ -27,14 +27,14 @@ const environment = await new DockerComposeEnvironment(
2727

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

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

3535
### With wait strategy
3636

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

49-
```javascript
49+
```js
5050
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
5151
.withDefaultWaitStrategy(Wait.forHealthCheck())
5252
.up();
@@ -56,7 +56,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
5656

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

59-
```javascript
59+
```js
6060
const { DockerComposeEnvironment, PullPolicy } = require("testcontainers");
6161

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

6767
Create a custom pull policy:
6868

69-
```typescript
69+
```ts
7070
const { GenericContainer, ImagePullPolicy } = require("testcontainers");
7171

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

8383
### With rebuild
8484

85-
```javascript
85+
```js
8686
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
8787
.withBuild()
8888
.up();
@@ -92,7 +92,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
9292

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

95-
```javascript
95+
```js
9696
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
9797
.withEnvironmentFile(".env.custom")
9898
.up();
@@ -102,15 +102,15 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
102102

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

105-
```javascript
105+
```js
106106
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
107107
.withProfiles("profile1", "profile2")
108108
.up();
109109
```
110110

111111
### With no recreate
112112

113-
```javascript
113+
```js
114114
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
115115
.withNoRecreate()
116116
.up();
@@ -126,7 +126,7 @@ services:
126126
image: redis:${TAG}
127127
```
128128
129-
```javascript
129+
```js
130130
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
131131
.withEnvironment({ "TAG": "VALUE" })
132132
.up();
@@ -136,7 +136,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
136136

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

139-
```javascript
139+
```js
140140
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
141141
.withProjectName("test")
142142
.up();
@@ -146,7 +146,7 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
146146

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

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

158158
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.
159159

160-
```javascript
160+
```js
161161
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
162162
await environment.down();
163163
```
164164

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

167-
```javascript
167+
```js
168168
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
169169
await environment.down({ timeout: 10_000 }); // 10 seconds
170170
```
171171

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

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

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

183-
```javascript
183+
```js
184184
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile).up();
185185
await environment.stop();
186186
```
@@ -189,6 +189,6 @@ await environment.stop();
189189

190190
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.
191191

192-
```javascript
192+
```js
193193
const container = environment.getContainer("alpine-1");
194194
```

0 commit comments

Comments
 (0)