Replies: 2 comments 1 reply
-
@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 was very happy to see support for
--cache-from
and--cache-to
appear in buildah 1.27.0. (I used to use Kaniko with its--cache
argument 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.18
is approximately 350MB, and every one of theENV
,WORKDIR
, andCOPY
lines 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 thegolang
container image with minor addons.Under Kaniko (with suitable modifications to replace
RUN --mount...
with something that works), all of those cache layers for theENV
lines 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