feat(script): add privileged flags to docker

This commit is contained in:
Ludovic DEHON
2025-01-03 16:48:44 +01:00
parent e1c202a3cb
commit e8ee97e26d
2 changed files with 17 additions and 0 deletions

View File

@@ -113,6 +113,12 @@ public class DockerOptions {
@PluginProperty(dynamic = true)
private String shmSize;
@Schema(
title = "Give extended privileges to this container."
)
@PluginProperty(dynamic = true)
private Boolean privileged;
@Deprecated
public void setDockerHost(String host) {
this.host = host;

View File

@@ -264,6 +264,12 @@ public class Docker extends TaskRunner {
@PluginProperty(dynamic = true)
private String shmSize;
@Schema(
title = "Give extended privileges to this container."
)
@PluginProperty(dynamic = true)
private Boolean privileged;
@Schema(
title = "File handling strategy.",
description = """
@@ -312,6 +318,7 @@ public class Docker extends TaskRunner {
.cpu(dockerOptions.getCpu())
.memory(dockerOptions.getMemory())
.shmSize(dockerOptions.getShmSize())
.privileged(dockerOptions.getPrivileged())
.build();
}
@@ -729,6 +736,10 @@ public class Docker extends TaskRunner {
hostConfig.withShmSize(convertBytes(runContext.render(this.getShmSize())));
}
if (this.getPrivileged() != null) {
hostConfig.withPrivileged(this.getPrivileged());
}
if (this.getNetworkMode() != null) {
hostConfig.withNetworkMode(runContext.render(this.getNetworkMode(), additionalVars));
}