From b61d15519bb2dcac7a9a6ee16abe5809cb4c9e0c Mon Sep 17 00:00:00 2001 From: Nathan W Date: Mon, 6 Mar 2023 09:23:00 -0700 Subject: [PATCH 1/2] Adding user option to template Some containers do not support PUID and GUID, in that case it is handy to have an option to pass the user to the container from the compose file --- templates/docker-compose.yml.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index ba2d998..193790f 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -154,6 +154,9 @@ services: - {{ envfile }} {% endfor %} {% endif %} +{% if container.user is defined %} + user: {{ container.user }} +{% endif %} {% if container.restart is defined %} restart: {{ container.restart }} {% endif %} From d297757876939f1ae0a7ef2f0f1afbf4f900f71e Mon Sep 17 00:00:00 2001 From: Nathan Warner Date: Mon, 6 Mar 2023 21:29:09 -0700 Subject: [PATCH 2/2] Removing extra whitespace --- templates/docker-compose.yml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 193790f..5dc1d75 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -23,13 +23,13 @@ services: privileged: {{ container.privileged }} {% endif %} {% if container.cap_add is defined %} - cap_add: + cap_add: {% for cap in container.cap_add %} - {{ cap }} {% endfor %} {% endif %} {% if container.group_add is defined %} - group_add: + group_add: {% for group in container.group_add %} - {{ group }} {% endfor %}