From 08be8b288fcb7046c11a88816af1db8c741ee63c Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Thu, 2 Jan 2025 14:48:32 +0000 Subject: [PATCH] Add userID control over compose containers --- templates/engine/docker-compose.jsonnet | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/engine/docker-compose.jsonnet b/templates/engine/docker-compose.jsonnet index c37f1df0..0be3c3e3 100644 --- a/templates/engine/docker-compose.jsonnet +++ b/templates/engine/docker-compose.jsonnet @@ -22,6 +22,8 @@ with_image:: function(x) self + { image: x }, + with_user:: function(x) self + { user: x }, + with_command:: function(x) self + { command: x }, with_environment:: function(x) self + { @@ -75,6 +77,10 @@ { command: container.command } else {}) + + (if std.objectHas(container, "user") then + { user: container.user } + else {}) + + (if ! std.isEmpty(container.environment) then { environment: container.environment } else {}) +