mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
feat(script): add privileged flags to docker
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user