Replies: 3 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
|
@kohenkatz Did you ever find a solution here?
Which Now, vfs is known for being slow and having to copy data around for every layer. In theory I would not expect this to affect the size and contents of the image layers that end up in the cache (I would expect vfs to still diff the layers' root file systems against each other) but maybe I'm wrong? |
Beta Was this translation helpful? Give feedback.
-
|
I have the same problem here. Buildah running in k8s behaves the same way: with each line of dockerfile it pushes to a cache repository the whole filesystem image, not just built layer. Building some heavier images gets way too slow due to cache pushing/pulling overhead, some of my builds got 2-3 times slower compared to kaniko builds. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was very happy to see support for
--cache-fromand--cache-toappear in buildah 1.27.0. (I used to use Kaniko with its--cacheargument which did the same thing, but Kaniko does not have proper support forRUN --mount....)The problem I have is with the size of the cache (and therefore also the build time).
Here's an example file:
Here's the command I use to run it:
I first noticed the issue because the build was running extremely slowly. It turns out that
docker.io/library/golang:1.18is approximately 350MB, and every one of theENV,WORKDIR, andCOPYlines below that was generating another 350MB cache image. By the time this build was done running, it was using several GB of storage space, the vast majority of it being duplicated copies of thegolangcontainer image with minor addons.Under Kaniko (with suitable modifications to replace
RUN --mount...with something that works), all of those cache layers for theENVlines are only a few KB.I assume this is probably an artifact of how buildah handles the layers - each layer is cumulative from the layers below it - but it produces an enormous amount of wasted cache space.
Is there any way to customize or simplify the caching so it doesn't take up so much space on the server with duplicate data?
Beta Was this translation helpful? Give feedback.
All reactions