Skip to content

Commit 82c3ef8

Browse files
Fix tests for podman + update podman docs
1 parent 9bad277 commit 82c3ef8

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

docs/supported-container-runtimes.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,36 @@ Works out of the box.
88

99
### Usage
1010

11-
MacOS:
11+
#### MacOS:
12+
1213
```bash
1314
{% raw %}
1415
export DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')
1516
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
1617
{% endraw %}
1718
```
1819

19-
Linux:
20-
```bash
21-
export DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock
22-
```
20+
#### Linux:
21+
22+
1. Ensure the Podman socket is exposed:
23+
24+
Rootless:
25+
26+
```bash
27+
systemctl --user status podman.socket
28+
```
29+
30+
Rootful:
31+
32+
```bash
33+
sudo systemctl enable --now podman.socket
34+
```
35+
36+
2. Export the `DOCKER_HOST`:
37+
38+
```bash
39+
export DOCKER_HOST="unix://$(podman info --format '{{.Host.RemoteSocket.Path}}')"
40+
```
2341

2442
### Known issues
2543

@@ -71,10 +89,7 @@ You can use a composite wait strategy to additionally wait for a port to be boun
7189
const { GenericContainer, Wait } = require("testcontainers");
7290

7391
const container = await new GenericContainer("redis")
74-
.withWaitStrategy(Wait.forAll([
75-
Wait.forListeningPorts(),
76-
Wait.forLogMessage("Ready to accept connections")
77-
]))
92+
.withWaitStrategy(Wait.forAll([Wait.forListeningPorts(), Wait.forLogMessage("Ready to accept connections")]))
7893
.start();
7994
```
8095

packages/testcontainers/src/reaper/reaper.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ describe("Reaper", { timeout: 120_000 }, () => {
6060

6161
const reaperContainer = client.container.getById(reaper.containerId);
6262
const ports = (await reaperContainer.inspect()).HostConfig.PortBindings;
63-
expect(ports["8080"][0].HostPort).toBe(customPort);
63+
const port = ports["8080"] || ports["8080/tcp"];
64+
expect(port[0].HostPort).toBe(customPort);
6465
});
6566

6667
it("should create Reaper container without RYUK_VERBOSE env var by default", async () => {

0 commit comments

Comments
 (0)