выполненная лаб2

This commit is contained in:
2026-10-22 17:11:47 +03:00
parent 65003b6119
commit 508340638d
39 changed files with 3547 additions and 33 deletions
+4
View File
@@ -0,0 +1,4 @@
import json, subprocess, sys
ids=subprocess.check_output(['docker','compose','ps','-q',*(sys.argv[1:] or ['api','postgres','redis'])],text=True).split()
rows=json.loads(subprocess.check_output(['docker','inspect',*ids],text=True))
print(json.dumps([{'name':r['Name'],'id':r['Id'],'started_at':r['State']['StartedAt'],'volumes':[{'name':m.get('Name'),'destination':m['Destination']} for m in r['Mounts'] if m['Type']=='volume']} for r in rows],indent=2))