container-diff
container-diff copied to clipboard
daemon does not recognize local images
The daemon:// prefix does not result in local images being recognized / used.
Possibly related to https://github.com/GoogleContainerTools/container-diff/issues/318
Expected behavior
I want to diff two images - one that was built on my machine, and one that was built remotely and downloaded to my machine as part of a docker run cycle.
I list the images resident on my machine via docker images and note the two image IDs I want to diff.
I run:
container-diff diff daemon://4ff36b039484 daemon://085b31f1637a
I expect the diff to be executed.
Actual behavior
The response is:
ERRO[0000] error retrieving image daemon://085b31f1637a: retrieving image from daemon: Error response from daemon: reference does not exist
The image does exist: I just copied and pasted it from the docker images output.
Information
- container-diff version: v0.17.0
- Operating system: OSX 10.15.7
- Docker desktop: 4.1.0 (69386)
Steps to reproduce the behavior
- Create a simple Dockerfile
- Do a local
docker build - Make a small change to the Dockerfile
- Build that from another machine and upload to a docker registry, e.g. Docker Hub or Google Artifact Registry (what I use)
- Do a
docker runof the remote image ID to cause it to be downloaded - Attempt to diff the images as described above
Images already resident on my machine should not require any authorization or download.
There is an ugly workaround:
docker export $(docker run -d 4ff36b039484 /bin/true) | docker import - local
docker export $(docker run -d 085b31f1637a /bin/true) | docker import - remote
container-diff diff daemon://local daemon://remote
That flattens both images. No error message in this case.