container-diff icon indicating copy to clipboard operation
container-diff copied to clipboard

daemon does not recognize local images

Open chrisj-back2work opened this issue 4 years ago • 1 comments
trafficstars

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

  1. Create a simple Dockerfile
  2. Do a local docker build
  3. Make a small change to the Dockerfile
  4. Build that from another machine and upload to a docker registry, e.g. Docker Hub or Google Artifact Registry (what I use)
  5. Do a docker run of the remote image ID to cause it to be downloaded
  6. Attempt to diff the images as described above

Images already resident on my machine should not require any authorization or download.

chrisj-back2work avatar Oct 11 '21 11:10 chrisj-back2work

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.

chrisj-back2work avatar Oct 11 '21 14:10 chrisj-back2work