werf new feature: Layer-by-layer caching for Dockerfiles builder #5137
shurup
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Briefly
rock-solid
) starting from v1.2.184.Background
werf has its own built-in build mechanism that supports atomic saving of the layers of the images being built into the registry and reuse of previously built layers available on other hosts. Once built, the layer is published to the registry. At this point, it becomes available as a cache for reuse for any build runner. werf also enforces the immutability of the published images and intermediate layers — these cannot be overwritten while keeping the original tag (this ensures the reproducibility of the builds in the CI/CD flow).
Most importantly, all of this does not require any additional configuration. All you need to do is specify the same registry repo address for werf commands run on the same or different hosts. These commands will communicate with each other to publish shared images and reuse them.
Previously, such a mechanism was in place for all build stages of the Stapel builder (
beforeInstall
,install
,beforeSetup
,setup
, etc.). This mechanism was also available for the Dockerfile-based builder, albeit with reduced functionality — only the final layer of the image built with the Dockerfile was saved.It now also supports saving the individual image layers built based on the Dockerfile. Note that this mechanism is only available for the Buildah-based backend, which will eventually become the primary builder. There are no plans to implement it for a Docker-based backend.
Details
Enable the Buildah-based backend for building images:
Add the
staged: true
directive towerf.yaml
(by default, the Dockerfile-based builds run without layer-by-layer caching; turning it on will result in image rebuild):What does pre-alpha mean?
Pre-alpha refers to the phase in which a feature undergoes active testing and evaluation. It means that future werf releases may have updates and fixes that make the build cache invalid. During this phase, we also collect feedback on any emerging problems and try to fix them promptly.
Beta Was this translation helpful? Give feedback.
All reactions