forked from earthly/earthly
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Summary
Layers built inside a FROM DOCKERFILE block do not benefit from --save-inline-cache / --use-inline-cache. Local BuildKit layer caching works fine — the issue is specifically that the inline cache mechanism does not appear to cover layers produced by the Dockerfile frontend.
Minimal reproduction
# images/node/Dockerfile
FROM public.ecr.aws/amazonlinux/amazonlinux:2023-minimal@sha256:13bffb7...
RUN microdnf -y install ca-certificates curl-minimal jq && \
microdnf clean allVERSION 0.8
node-image:
FROM DOCKERFILE -f ./images/node/Dockerfile .
SAVE IMAGE --push ghcr.io/example/node:latestearthly --use-inline-cache --save-inline-cache --push +node-imageOn a fresh runner (no local BuildKit cache), the microdnf install layer rebuilds every time despite nothing in the Dockerfile having changed.
Question
Is there something we need to pass through to BuildKit (e.g. BUILDKIT_INLINE_CACHE=1 or equivalent) so that the Dockerfile frontend embeds inline cache metadata into its layers? Or is this a known limitation of FROM DOCKERFILE?
Workaround
Converting to native Earthfile FROM + RUN commands makes inline caching work as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels