refactor: Update Docker inspect command to retrieve container labels

This commit is contained in:
2024-09-04 10:56:57 +08:00
parent d9f2b4cad7
commit b1866b26e7
+1 -3
View File
@@ -1,3 +1 @@
docker inspect -f '{{ range $k, $v := .Config.Labels -}}
{{ $k }}={{ $v }};
{{ end -}}' $cid
docker node ls -q | xargs docker node inspect -f '{{ .ID }} [hostname={{ .Description.Hostname }}, Addr={{ .Status.Addr }}, State={{ .Status.State }}, Role={{ .Spec.Role }}, Availability={{ .Spec.Availability }}]: Arch={{ .Description.Platform.Architecture }}, OS={{ .Description.Platform.OS }}, NanoCPUs={{ .Description.Resources.NanoCPUs }}, MemoryBytes={{ .Description.Resources.MemoryBytes }}, docker_version={{ .Description.Engine.EngineVersion }}, labels={{ range $k, $v := .Spec.Labels }}{{ $k }}={{ $v }} {{end}}'