Why doesn't my newly-created docker have a digest?

Firstly, Please keep in mind that a digest could represent a manifest, a layer or a combination of them (we normally called that combination an image).

Manifest is a new term that introduced with Docker registry V2. Here is a short description fetched from Docker Registry V2 slides page21 ~ page23:

  • [Manifest] describes the components of an image in a single object
    • Layers can be fetched immediately, in parallel.

When you get the digests with command docker images --digests, here the digest is the SHA256 hash of image manifest, but image ID is the hash code of the local image JSON configuration (this configuration is different from manifest). In this case, if an image doesn't have an associated manifest, the digest of that image will be "none".

Normally, two scenarios could make an image doesn't have associated manifest:

  1. This image has not been pushed to or pulled from a V2 registry.
  2. This image has been pulled from a V1 registry.

To generate a manifest, the easiest way is to push the image to a V2 registry (V1 registry will not works). Docker client will generate a manifest locally, then push it with image layers to registry. When you pull the image back, the image will has a manifest.

Once the manifest existing, your image digest should not be "none".


Yes it is related to how the images were created. Docker can be a real stinker at times.

This may be helpful for you in this case.

Tags:

Docker

Digest