Skip to content

Commit 2f9e0e6

Browse files
committed
fix(compose-ng): add support for setting container devices
1 parent ab48dcd commit 2f9e0e6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docker/compose/ng.sls

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ include:
126126
- restart_policy: {{ policy[0] }}:{{ policy[-1] }}
127127
{%- endif %}
128128
{%- endif %}
129+
{%- if 'devices' in container %}
130+
- devices:
131+
{%- for device in container.devices %}
132+
{%- set mapping = device.rsplit(':', 1) %}
133+
{%- if mapping|length > 1 %}
134+
- "{{ mapping[0] }}:{{ mapping[-1] }}"
135+
{%- else %}
136+
- "{{ mapping[0] }}"
137+
{%- endif %}
138+
{%- endfor %}
139+
{%- endif %}
129140
- require:
130141
- docker_image: {{ formula }}-compose-ng-{{ id }}-present
131142
{%- if required_containers is defined %}

0 commit comments

Comments
 (0)