Skip to content

Commit b9b1270

Browse files
committed
feat(jinja-template): added SSH Secret Mounts to Dockerfile template, #18
1 parent fb021f5 commit b9b1270

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

rigel/plugins/core/dockerfile/assets/dependencies.j2

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ ENV {{ env.name }}={{ env.value }}
1010
{% endfor %}
1111
{% endif -%}
1212

13-
# Set-up build secrets
13+
# Set-up Build Secrets
1414
{% if configuration.secrets is defined and configuration.secrets|length > 0 -%}
15+
# - Secret mounts
1516
{% for secret in configuration.secrets -%}
1617
RUN --mount=type=secret,id={{ secret.id }}{% if secret.target != None %},target={{ secret.target }}{% endif %}{% if secret.env != None %},env={{ secret.env }}{% endif %}{% if secret.required != secret.DEFAULT_REQUIRED %},required={{ secret.required }}{% endif %}{% if secret.mode != secret.DEFAULT_MODE %},mode={{ secret.mode }}{% endif %}{% if secret.uid != secret.DEFAULT_UID %},uid={{ secret.uid }}{% endif %}{% if secret.gid != secret.DEFAULT_GID %},gid={{ secret.gid }}{% endif %} \
1718
echo "Remove this line and add your commands to run with the secret"
1819
{% endfor %}
1920
{% endif -%}
2021

22+
{% if configuration.ssh is defined and configuration.ssh|length > 0 -%}
23+
# - SSH mounts
24+
{% for ssh in configuration.ssh -%}
25+
RUN --mount=type=ssh,id={{ ssh.id }}{% if ssh.target != None %},target={{ ssh.target }}{% endif %}{% if ssh.required != ssh.DEFAULT_REQUIRED %},required={{ ssh.required }}{% endif %}{% if ssh.mode != ssh.DEFAULT_MODE %},mode={{ ssh.mode }}{% endif %}{% if ssh.uid != ssh.DEFAULT_UID %},uid={{ ssh.uid }}{% endif %}{% if ssh.gid != ssh.DEFAULT_GID %},gid={{ ssh.gid }}{% endif %} \
26+
echo "Remove this line and add your commands to run with the SSH agent/key"
27+
{% endfor %}
28+
{% endif -%}
29+
2130
# Install dependencies.
2231
RUN for i in $(seq 1 5); do \
2332
if sudo apt-get clean && sudo apt-get update && sudo apt-get install -y \

0 commit comments

Comments
 (0)