Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
Created August 19, 2016 01:55
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save steve-jansen/a90f942e05e326e817aaeb04dff3f4e6 to your computer and use it in GitHub Desktop.
Save steve-jansen/a90f942e05e326e817aaeb04dff3f4e6 to your computer and use it in GitHub Desktop.
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