wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
46.68k stars 1.77k forks source link

How to diff 2 images after updates? #365

Open marcellodesales opened 3 years ago

marcellodesales commented 3 years ago

I reverted a commit and the new image has more files than the previous one.

Problem

$ git --no-pager diff eab35e3e 1cd35f7d Dockerfile
$ docker images | grep flutter-web
flutter-web-docker-image   eab35e3e-master         a6e26ee2cf74   16 minutes ago   1.53GB
flutter-web-docker-image   1cd35f7d-master           c1d14989a2a7   3 weeks ago      1.47GB

Verification

docker-compose build
$ git checkout 1cd35f7d
$ docker-compose build 
$ docker tag flutter-web-app flutter-web-app-old:1cd35f7d
$ docker images | grep web
flutter-web-app-old            1cd35f7d          11ab0de3b8fe   2 minutes ago       1.53GB
fflutter-web-app                  latest         11ab0de3b8fe   2 minutes ago       1.53GB
flutter-web-docker-image   1cd35f7d-master      c1d14989a2a7   3 weeks ago         1.47GB

Possible problem

# Clone the flutter repo
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter

There's also the apt-get install which has some libraries without versions

# https://deepsource.io/gh/milou212/test/issue/DOK-DL3009/description/
RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 \
                                 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3 psmisc && \
   apt-get clean && \
   rm -rf /var/lib/apt/lists/*