Skip to content

How to diff 2 images after updates? #365

@marcellodesales

Description

@marcellodesales

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

Problem

  • The Dockerfile was not changed
$ git --no-pager diff eab35e3e 1cd35f7d Dockerfile
  • However, images were created days apart
$ 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
  • I'd like to understand what layer added more files... I'm sure it's the apt-get install, but I'd like to know which dirs contributed to the change of almost 100MB

Verification

  • I built the current image
docker-compose build
  • Then, I built the old image again
$ git checkout 1cd35f7d
$ docker-compose build 
$ docker tag flutter-web-app flutter-web-app-old:1cd35f7d
  • As there are no changes to the Dockerfile, the images are still the same
    • Note that the image flutter-web-app-old is the same as current because the Dockerfile hasn't changed its lines
$ 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

  • I clone the default branch of a github repo.
    • It might have changed as well
# 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/*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions