Skip to content

Commit

Permalink
Add property to start ryuk in privileged mode (#894)
Browse files Browse the repository at this point in the history
Closes #871
  • Loading branch information
atomfrede authored and kiview committed Oct 10, 2018
1 parent aa762fb commit 16326e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Expand Up @@ -79,6 +79,7 @@ public static String start(String hostIpAddress, DockerClient client) {
.withName("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID)
.withLabels(Collections.singletonMap(DockerClientFactory.TESTCONTAINERS_LABEL, "true"))
.withBinds(binds)
.withPrivileged(TestcontainersConfiguration.getInstance().isRyukPrivileged())
.exec()
.getId();

Expand Down
Expand Up @@ -46,6 +46,10 @@ public String getTinyImage() {
return (String) properties.getOrDefault("tinyimage.container.image", "alpine:3.5");
}

public boolean isRyukPrivileged() {
return Boolean.parseBoolean((String) properties.getOrDefault("ryuk.container.privileged", "false"));
}

public String getRyukImage() {
return (String) properties.getOrDefault("ryuk.container.image", "quay.io/testcontainers/ryuk:0.2.2");
}
Expand Down
6 changes: 6 additions & 0 deletions docs/usage/properties.md
Expand Up @@ -37,5 +37,11 @@ It takes a couple of seconds, but if you want to speed up your tests, you can di
> **kafka.container.image = confluentinc/cp-kafka**
> Used by KafkaContainer
## Customizing ryuk resource reaper
> **ryuk.container.image = quay.io/testcontainers/ryuk:0.2.2**
> The resource reaper is responsible for container removal and automatic cleanup of dead containers at JVM shutdown
> **ryuk.container.privileged = false**
> In some environments ryuk must be started in privileged mode to work properly (--privileged flag)
Testcontainers uses public Docker images to perform different actions like startup checks, VNC recording and others.
Some companies disallow the usage of Docker Hub, but you can override `*.image` properties with your own images from your private registry to workaround that.

0 comments on commit 16326e2

Please sign in to comment.