ЛР 2 — БВТ2301 — Майорова — на 5
Application / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-23 11:13:22 +03:00
parent 65003b6119
commit 400e62ffdc
36 changed files with 4751 additions and 37 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
"""Record restart evidence without env, credentials or machine-specific labels."""
import json
import subprocess
ids = subprocess.check_output(['docker', 'compose', 'ps', '-q', 'api', 'postgres', 'redis'], text=True).split()
containers = json.loads(subprocess.check_output(['docker', 'inspect', *ids], text=True))
result = []
for container in containers:
result.append(dict(service=container['Config']['Labels']['com.docker.compose.service'], container_id=container['Id'][:12], started_at=container['State']['StartedAt'], status=container['State']['Status'], volumes=[m['Name'] for m in container['Mounts'] if m['Type'] == 'volume']))
print(json.dumps(sorted(result, key=lambda x: x['service']), indent=2))