Closed eunomie closed 5 years ago
Ok, so I have this workflow:
{
"description": "A short description of your bundle",
"invocationImages": [
{
"image": "noaccesstothisregistry/push-test-cnab:742d5c8bd222737511ebc213cf7d99c40b32ef60",
"imageType": "docker"
}
],
"keywords": [
"push-test",
"cnab",
"tutorial"
],
"maintainers": [
{
"email": "john.doe@example.com",
"name": "John Doe",
"url": "https://example.com"
},
{
"email": "jane.doe@example.com",
"name": "Jane Doe",
"url": "https://example.com"
}
],
"name": "push-test",
"schemaVersion": "v1.0.0-WD",
"version": "0.1.0"
}
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
noaccesstothisregistry/push-test-cnab 742d5c8bd222737511ebc213cf7d99c40b32ef60 3aeba8c4e1e8 About a minute ago 11.1MB
alpine latest 961769676411 7 weeks ago 5.58MB
registry latest f32a97de94e1 7 months ago 25.8MB
$ cnab-to-oci push ignore/push-test/bundle.json --push-images --auto-update-bundle -t localhost:5000/from-daemon:v1 --log-level debug
$ cnab-to-oci pull localhost:5000/from-daemon:v1 --log-level debug
cnab-to-oci push pulled.json --push-images -t localhost:5000/pulled-and-pushed:v1 --log-level debug
DEBU[0000] Fixing up bundle localhost:5000/pulled-and-pushed:v1
DEBU[0000] Updating entry in relocation map for "noaccesstothisregistry/push-test-cnab:742d5c8bd222737511ebc213cf7d99c40b32ef60"
Starting to copy image noaccesstothisregistry/push-test-cnab:742d5c8bd222737511ebc213cf7d99c40b32ef60...
Failed to copy image noaccesstothisregistry/push-test-cnab:742d5c8bd222737511ebc213cf7d99c40b32ef60: Error response from daemon: No such image: sha256:43b67c7bbc1dadd39e61ba9b0711c71035b0d0401d9a90a24cca34edfdb1659e
Error: Error response from daemon: No such image: sha256:43b67c7bbc1dadd39e61ba9b0711c71035b0d0401d9a90a24cca34edfdb1659e
Even if it is the same image, because we're trying to access it by SHA, that is not available locally - how is the SHA propagated locally after a push? Could we ensure the image is available in such scenarios?
Typos are fixed. We can now configure output (discarded by default). Dependencies are updated.
I was also able to perform a full push - pull - push cycle as in https://github.com/docker/cnab-to-oci/pull/76#issuecomment-542354769 without issue.
^ @radu-matei I let you merge 😄
I just tried again the same workflow from https://github.com/docker/cnab-to-oci/pull/76#issuecomment-542354769 and now it works - most likely it was because of https://github.com/docker/cnab-to-oci/pull/76#discussion_r335126652.
Allow
push
command andremotes.Fixup
to be able to push missing images from the local docker daemon image store.A
--push-images
flag is added to thepush
command. This flag will act during thefixup
phase. If an image is not found, instead of just printing a message saying you need to push the image before, the image will be pushed if available in the local docker daemon image store.The
fixup
command doesn't change, there's no option to "fixup and push" if you want to do that, usepush
.