Skip to content

Commit 881b797

Browse files
authored
Fix malformed 'devices' values
1 parent a1f2aab commit 881b797

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autocompose.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def generate(cname):
4949
'cap_drop': cattrs['HostConfig']['CapDrop'],
5050
'cgroup_parent': cattrs['HostConfig']['CgroupParent'],
5151
'container_name': cattrs['Name'][1:],
52-
'devices': cattrs['HostConfig']['Devices'],
52+
'devices': [],
5353
'dns': cattrs['HostConfig']['Dns'],
5454
'dns_search': cattrs['HostConfig']['DnsSearch'],
5555
'environment': cattrs['Config']['Env'],
@@ -80,6 +80,10 @@ def generate(cname):
8080
'tty': cattrs['Config']['Tty']
8181
}
8282

83+
# Populate devices key if device values are present
84+
if cattrs['HostConfig']['Devices']:
85+
values['devices'] = [x['PathOnHost']+':'+x['PathInContainer'] for x in cattrs['HostConfig']['Devices']]
86+
8387
networks = {}
8488
if values['networks'] == set():
8589
del values['networks']

0 commit comments

Comments
 (0)