Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List labels for a docker container
docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
{{ $k }}={{ $v }}
{{ end -}}' $cid
@jmartens
Copy link

jmartens commented Oct 19, 2022

Or if you don't mind json output: docker inspect -f "{{json .Config.Labels}}" $cid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment