March 19, 2017

Docker Identifiers

Identifiers

A Docker Container can be identified in three ways: long form UUID (Universally Unique Identifier), a short form UUID and by Name. Identifiers help prevent naming conflicts and facilitate automation.
  • UUID
    • Universally Unique Identifier
    • Assigned to a container on creation.
    • UUIDs come in two forms:
      • a 64 character long form, e.g.
        • “f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”
      • an abbreviated 12 character short form, e.g.
        • “f78375b1c487”
    • automatically generated and applied by the Docker daemon
    • Identifiers are commonly displayed in a truncated 12-character form
  • Name
    • A container name is generated and automatically assigned
    • Generated name format: <adjective>_<notable names>
      • On the left a list of strings, approximately 90 adjectives
      • On the right a list of approximately 150 "notable" scientists and hackers
    • Manually assign a container name using the --name option

    • The NAMES column lists the generated and manually assigned names. "testvol" is a manually assigned container name.
    • Images can be further identified using: image:[tag] and image@[digest]
      • Image:[tag]
        • :tag allows you to add a version to an image, e.g. ubuntu:16.04, where ubuntu is the image, 16.04 is the tag (or version)
      • Image:[@digest]
        • A content addressable identifier, e.g.  sha256:58e1a1bb75db1b5a24a462dd5e2915277ea06438c3f105138f97eb53149673c4
        • As long as the makeup of the image is the same, it's DIGEST value is a predictable and referenceable value, i.e. two images with the same DIGEST value can be assumed to be the same image
        • docker images --digests to display the DIGEST value of an image
        • An image can be pulled using the DIGEST value
    • Images and containers may be identified in one of three ways:
    • Identifier Type Example Value Length
      UUID long identifier f78375b1c887e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778 64-character
      UUID short identifier f78375b1c887 12-character
      Name Pseudo-random generated names Variable
      Tag String identifying a version of an image Variable
      Digest Calculated SHA value of an image 64-character

    References:

No comments:

Post a Comment