This repository was archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
[bug] hiting the cache even tough docker image has changed #332
Copy link
Copy link
Closed
Labels
Description
Expected behavior
- container-diff diff image-a image-b --type=file
- docker pull image-a or docker build . --tag image a
- container-diff diff image-a image-b --type=file
should produce different results.
Actual behavior
Currently, running the same sequence of steps don't produce different results (the cached version gets repeated) and it's not obvious for the end-user which specific versions of the images were compared.
Comment about implementation:
It seems that the docker image is based off the argument passed as image name alone, and no inspecting on the image is actually done.
One possible solution could be to use the image digest combined with the name for the cache key.
Information
- container-diff version: v0.15.0
- Operating system: OSX 10.15.4
Steps to reproduce the behavior
- Create image-a
FROM busybox
RUN echo "hi" > /hello
CMD ["cat", "/hello"]
Then
docker build -t image-a:latest -f Dockerfile.a .
- Create image-b
FROM busybox
RUN echo "ola" > /hello
CMD ["cat", "/hello"]
Then
docker build -t image-b:latest -f Dockerfile.b .
- Perform diff
container-diff diff daemon://image-a daemon://image-b --type=file
Output:
➜ container-diff-test container-diff diff daemon://image-a:latest daemon://image-b:latest --type=file
-----File-----
These entries have been added to image-a:latest: None
These entries have been deleted from image-a:latest: None
These entries have been changed between image-a:latest and image-b:latest:
FILE SIZE1 SIZE2
/hello 3B 4B
- Rebuild b
# change ola to 'hi' in Dockerfile.b and rebuild it with:
docker build -t image-b:latest -f Dockerfile.b .
- Diff a and b again
➜ container-diff-test container-diff diff daemon://image-a:latest daemon://image-b:latest --type=file
-----File-----
These entries have been added to image-a:latest: None
These entries have been deleted from image-a:latest: None
These entries have been changed between image-a:latest and image-b:latest:
FILE SIZE1 SIZE2
/hello 3B 4B
I would expect the following output:
➜ container-diff-test container-diff diff daemon://image-a:latest daemon://image-b:latest --type=file
-----File-----
These entries have been added to image-a:latest: None
These entries have been deleted from image-a:latest: None
These entries have been changed between image-a:latest and image-b:latest: None
( To get this I had to remove the cache file)
jtagcat