Fix Kaniko layer cache miss on bundle install #152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Standalone — discovered during pipeline investigation (pipelines 327/328).
Repo
ldraney/landscaping-assistantWhat Broke
Kaniko layer cache never hits for the
RUN bundle installstep. Every pipeline run rebuilds gems from scratch inside the Docker build (~2-3 min wasted). Pipeline logs showNo cached layer found for cmd RUN bundle installon every build.Root cause:
COPY vendor/* ./vendor/in the Dockerfile copies CI-installed gems fromvendor/bundleinto the build context. This changes the layer hash every run, invalidating the cache for everything after it. The copied gems aren't even used — the Dockerfile'sbundle installinstalls to$BUNDLE_PATH(from the base image), not./vendor/bundle.Repro Steps
No cached layer found for cmd RUN bundle installevery time, even when Gemfile/Gemfile.lock unchangedExpected Behavior
Kaniko should cache-hit on the
RUN bundle installlayer when Gemfile/Gemfile.lock haven't changed, showingUsing cached layerin logs.Environment
Acceptance Criteria
Using cached layerfor bundle installRelated
landscaping-assistantproject