Skip to content

Commit 451147f

Browse files
Merge branch 'main' into ubuntu-24.04
2 parents 3255c46 + 8d320dc commit 451147f

File tree

201 files changed

+7115
-7148
lines changed

Some content is hidden

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

201 files changed

+7115
-7148
lines changed

.github/workflows/checks.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
modules_count: ${{ steps.set-modified-modules-count.outputs.modules_count }}
2828
steps:
2929
- name: Check out code
30-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
uses: actions/checkout@v5
3131
- id: changed-files
3232
name: Get changed files
3333
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
@@ -56,7 +56,7 @@ jobs:
5656
runs-on: ubuntu-24.04
5757
steps:
5858
- name: Code checkout
59-
uses: actions/checkout@v4
59+
uses: actions/checkout@v5
6060
- name: Install Node and Dependencies
6161
id: npm-install-modules
6262
uses: ./.github/actions/npm-setup
@@ -82,7 +82,7 @@ jobs:
8282
runs-on: ubuntu-24.04
8383
steps:
8484
- name: Code checkout
85-
uses: actions/checkout@v4
85+
uses: actions/checkout@v5
8686
- name: Install Node and Dependencies
8787
id: npm-install
8888
uses: ./.github/actions/npm-setup
@@ -111,7 +111,7 @@ jobs:
111111
runs-on: ubuntu-24.04
112112
steps:
113113
- name: Code checkout
114-
uses: actions/checkout@v4
114+
uses: actions/checkout@v5
115115
- name: Install Node ${{ matrix.node-version }} and Dependencies
116116
uses: ./.github/actions/npm-setup
117117
with:
@@ -124,8 +124,12 @@ jobs:
124124
run: npm prune --omit=dev --workspace packages/testcontainers
125125
- name: Run CommonJS module smoke test
126126
run: node packages/testcontainers/smoke-test.js
127+
env:
128+
DEBUG: "testcontainers*"
127129
- name: Run ES module smoke test
128130
run: node packages/testcontainers/smoke-test.mjs
131+
env:
132+
DEBUG: "testcontainers*"
129133

130134
test:
131135
if: ${{ needs.detect-modules.outputs.modules_count > 0 }}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
- name: Initialize CodeQL
2929
uses: github/codeql-action/init@v3
3030
with:

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: "Checkout Repository"
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v5
1414
- name: "Dependency Review"
1515
uses: actions/dependency-review-action@v4
1616
with:

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
publish:
99
runs-on: ubuntu-24.04
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
with:
1313
ref: main
1414

.github/workflows/test-template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ${{ inputs.runner }}
2121
steps:
2222
- name: Code checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v5
2424

2525
- name: Docker rootless setup
2626
if: ${{ inputs.container-runtime == 'docker-rootless' }}
@@ -43,7 +43,7 @@ jobs:
4343
runner: ${{ inputs.runner }}
4444

4545
- name: Code checkout
46-
uses: actions/checkout@v4
46+
uses: actions/checkout@v5
4747

4848
- name: Install Node ${{ inputs.node-version }} and Dependencies
4949
id: npm-install

.github/workflows/windows-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
}
2828
2929
- name: Checkout
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
with:
3232
token: ${{ secrets.GITHUB_TOKEN }}
3333
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}

.prettierrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"printWidth": 120,
33
"trailingComma": "es5",
4-
"plugins": ["prettier-plugin-organize-imports"]
5-
}
4+
"plugins": [
5+
"prettier-plugin-organize-imports"
6+
],
7+
"endOfLine": "auto"
8+
}

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.14.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)