Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to view the aggregate difference between specific layers? #414

Open
Asday opened this issue Aug 23, 2022 · 3 comments
Open

Comments

@Asday
Copy link

Asday commented Aug 23, 2022

Suppose I have a Dockerfile with many layers, then the following

RUN apk add --virtual .build-deps some package names
RUN pip install some python package names
RUN apk del .build-deps

Then perhaps some more layers. Is there a way in dive to see the aggregate changes from the start of those three layers to the end, such that I can see what to COPY in a multi-stage build? As far as I can tell, I can only see the diff from the start to the end of a single layer, or from the start of the most base docker image(?) to the end of the current layer, which has a great deal of noise.

Note that I could change the Dockerfile to read something like

RUN apk add --virtual .build-deps some package names \
  && pip install some python package names \
  && apk del .build-deps

But that involves installing the build requirements every time the python package requirements change, rather than simply reusing a previous layer. (I'm also aware of buildkit's cache mounts and --no-cache for apk, but they're not relevant enough to the question to muddy the examples).

@mark2185
Copy link
Contributor

Just to clarify, you'd like to view aggregate changes from an arbitrary start layer, to an arbitrary end layer, instead of seeing the diff from the beginning to the current layer?

If so, that's currently not possible.

@Asday
Copy link
Author

Asday commented Aug 23, 2022

You've understood me perfectly, and also saddened me. Thank you.

In that case I'll leave this issue open as a feature request.

@mark2185
Copy link
Contributor

Don't hold your breath, though, the project isn't too active, unfortunately. Last significant changes were made back in 2020.

If you do decide to take matters into your own hands, please base it on top of #399 since it contains some much needed fixes already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants