Labels are a way to apply metadata to Docker object


  • alphanumeric string may have . or -
  • lowercase
  • . separates the namespace


  • any type can be represented as a string


  • labels on images, containers, local daemons, volumes, and networks are static for the lifetime of the object.
  • docker swarm nodes and service can update label dynamically.

image and container

  • Dockerfile - LABEL instruction

    • LABEL = =
  • runtime
 docker run -l empty-label --label ubuntu bash
 docker run --label-file ./labels ubuntu bash
  • filter label
  docker images --filter "key=value"
  docker ps --filter "key=value"