question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Digest output is image ID, not RepoDigest

See original GitHub issue

Troubleshooting

The output called digest is not in fact the digest that can be used to pull the image that was pushed to the repository. The metadata output has the same ID listed as "containerimage.digest".

Behaviour

Steps to reproduce this issue

  1. Use docker/build-push-action@v2 to build and push any image
  2. View the outputs of the step

Expected behaviour

Tell us what should happen

The output named digest should contain the digest of the image, not the ID.

i.e. the output of docker inspect $IMAGE | jq .[].RepoDigests

Actual behaviour

Tell us what happens instead

The output named digest contains the Image ID, i.e. the output of docker inspect $IMAGE | jq .[].ID

Configuration

DockerHub reports the Digest to be: sha256:abe87bda82fdf472763c5782bd787154fd5196dbf37bb5b94b3c757df71f0de3

docker/build-push-action@v2 outputs a digest of sha256:e72b6e4b4ed5763c94bfde0320282c8a3125152d8f2325d015c37a01eed2a9b2

Logs

Download the log file of your build and attach it to this issue.

1_Publish Docker image.txt

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kpcyrdcommented, Dec 8, 2022

The official docker-publish.yml template still links to here:

      # Workaround: https://github.com/docker/build-push-action/issues/461
      - name: Setup Docker buildx
        uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

Since this github issue is closed, can this workaround be removed?

1reaction
crazy-maxcommented, Dec 13, 2021

Having dug deeper on this issue, the digest output contains the remote digest if you run docker/setup-buildx-action before building.

If you do not call setup-buildx, then it seems to incorrectly populate digest with the local image ID as reported in the OP.

Thanks for your feedback, will take a look and come back to you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the difference between a Docker image's Image ID and ...
The short answer is: The "digest" is a hash of the manifest, introduced in Docker registry v2. The image ID is a hash...
Read more >
Docker Images: Name Vs. Tag Vs. Digest - HackerNoon
Pulling an image using name@sha256:digest. A digest is an id that is automatically created during build time and cannot be changed (immutable).
Read more >
Using container image digests | Cloud Architecture Center
If you use this command with a tag, it returns the image index if it exists. If not, it returns the image manifest....
Read more >
Digests in Docker - Mike Newswanger
If no tag is specified, latest is used. This tag is a pointer to an image–a set of files and metadata that Docker...
Read more >
Update your Docker containers safely - ADMIN Magazine
The "Id" (line 3) shows the image ID: The first 12 characters are the same as the output from docker images ; the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found