From 14c6df0af7d0f6d80fdf5854236eb1b197d7188b Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Thu, 9 Mar 2023 11:26:56 +0800 Subject: [PATCH] Update docker.py --- appmanage/api/utils/docker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appmanage/api/utils/docker.py b/appmanage/api/utils/docker.py index 2d8c336a..73050bf0 100644 --- a/appmanage/api/utils/docker.py +++ b/appmanage/api/utils/docker.py @@ -1,5 +1,5 @@ import os, io, sys, platform, shutil, time, json, datetime -import re +import re,docker from api.utils import shell_execute from api.utils import network @@ -10,6 +10,10 @@ from pathlib import Path def get_process_perc(app_name): process_now = "0%" + client = docker.from_env() + resp = client.api.pull(app_name, stream=True, decode=True) + for line in resp: + print(json.dumps(line, indent=4)) return process_now