Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to push the bundle following the steps in readme #96

Open
ywk253100 opened this issue Feb 12, 2020 · 1 comment
Open

Failed to push the bundle following the steps in readme #96

ywk253100 opened this issue Feb 12, 2020 · 1 comment

Comments

@ywk253100
Copy link

root@kube-worker:~/workspace/src/github.com/docker/cnab-to-oci# bin/cnab-to-oci push examples/helloworld-cnab/bundle.json --target myhubusername/repo
Starting to copy image cnab/helloworld:0.1.1...
Error: image "cnab/helloworld:0.1.1" digest differs "" after fixup: "sha256:a59a4e74d9cc89e4e75dfb2cc7ea5c108e4236ba6231b53081a9e2506d1197b6"
@radu-matei
Copy link
Member

Hi, @ywk253100,
Thanks a lot for reporting the issue!

#65 introduced a change in how we handle pushing images, so the current behaviour is that cnab-to-oci will fail if the registry generates a different content digest for any image referenced in the bundle.

    {
      "imageType": "docker",
      "image": "cnab/helloworld:0.1.1",
      "size": 42
    }
Error: image "cnab/helloworld:0.1.1" digest differs "" after fixup: "sha256:a59a4e74d9cc89e4e75dfb2cc7ea5c108e4236ba6231b53081a9e2506d1197b6"

(notice how the content digest obtained after pushing the image is different from the one initially included in the bundle).

The same change also introduced the --auto-update-bundle flag for push, which will automatically update the bundle with the new content digest.
The reason we chose not to do that by default is because this operation has to mutate your bundle file before pushing, and we believe this should be something a user should explicitly ask for.

That being said, we should absolutely have a working example in the readme, and should either:

  • update the readme to include the --auto-update-bundle flag for the push command
  • replace the example bundle with one that contains the content digest for the image - see below a minimal complete bundle example in canonical form:
{"description":"A short description of your bundle","invocationImages":[{"contentDigest":"sha256:a59a4e74d9cc89e4e75dfb2cc7ea5c108e4236ba6231b53081a9e2506d1197b6","image":"cnab/helloworld:0.1.1","imageType":"docker","mediaType":"application/vnd.docker.distribution.manifest.v2+json","size":942}],"keywords":["helloworld","cnab","tutorial"],"maintainers":[{"email":"jane.doe@example.com","name":"Jane Doe","url":"https://example.com"}],"name":"helloworld","schemaVersion":"v1.0.0-WD","version":"0.1.1"}

I hope this gives you a little context into what is happening.
Thanks a lot for reporting, keeping it open until we have a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants