docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`prune`: filtering out `ADD --checksum=... https://...` entries

fenollp opened this issue · comments

Description

I'd like to be able to run docker buildx prune but keep in cache the pinned ADD downloads.
Could we extend on the --filter=.. syntax?

Side curiosity: why are these cache entries marked Mutable: true?
From my understanding of du's docs that'd mean that its size can grow.

Is there a missed optimization opportunity of in the ADD op here, setting mutable=false?
cc moby/buildkit#975 (comment)

We could change the type for these to source.http like source.git.checkout and source.local instead of regular.

Mutable is because there was no need to make it immutable (there are no layers on top of it or images created directly from this data). It doesn't change anything for the cache reuse. Actual changing of the data is theoretical, currently there isn't any option that would for example add new files to same snapshot, or continue download or reuse previous snapshot of downloaded file and for example rename the file.

We could change the type for these to source.http like source.git.checkout and source.local instead of regular.

Are you implying there's a type filter today? Where is it documented?
If that's the case it sounds great to me :)

Yes, you can use docker buildx prune --filter 'type=source.local' for example but looks like the records created from ADD url are type=regular atm and don't have a specific type definition.