Open cdprete opened 3 months ago
Seeing the exact same thing, with the snapshotter taking a full filesystem snapshot at each new stage/FROM.
CI log exceprt:
- unzip -q /opt/kotlin-compiler-||||||.zip -d /opt
rm /opt/kotlin-compiler-||||||.zip INFO[0103] Taking snapshot of full filesystem...
INFO[0105] Saving file opt/kotlinc for later use
INFO[0105] Deleting filesystem...
INFO[0105] Base image from previous stage 1 found, using saved tar at path /kaniko/stages/1 INFO[0105] Executing 0 build triggers
INFO[0105] Building stage 'java' [idx: '4', base-idx: '1'] INFO[0105] Unpacking rootfs as cmd RUN export ANDROID_HOME="/opt/android-sdk" .......... INFO[0108] Initializing snapshotter ...
INFO[0108] Taking snapshot of full filesystem...
INFO[0113] SHELL ["/bin/bash", "-exo", "pipefail", "-c"] INFO[0113] RUN export ANDROID_HOME="/opt/android-sdk" && export ............... ..................Accept? (y/N): All SDK package licenses accepted
- true INFO[0142] Taking snapshot of full filesystem...
INFO[0212] Saving file opt/android-sdk for later use
INFO[0275] Deleting filesystem...
INFO[0276] Base image from previous stage 1 found, using saved tar at path /kaniko/stages/1 INFO[0276] Executing 0 build triggers
INFO[0277] Building stage 'java' [idx: '5', base-idx: '1'] INFO[0309] Unpacking rootfs as cmd COPY --from=gradle /opt/gradle /opt/gradle requires it. INFO[0313] Initializing snapshotter ...
INFO[0313] Taking snapshot of full filesystem... .......................
Dockerfile structure is similar to this:
FROM ... AS base
LABEL ...
LABEL ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ARG ...
ENV ...
SHELL ...
RUN ...
FROM base AS java
SHELL ...
RUN ...
FROM base AS gradle
SHELL ...
RUN ...
FROM base AS kotlin
SHELL ...
RUN ...
FROM java AS android
SHELL ...
RUN ...
FROM java AS final
COPY --from=gradle ... ...
COPY --from=kotlin ... ...
COPY --from=android ... ...
ENV ....
ENV ....
SHELL ....
RUN .....
ENTRYPOINT ...
The kaniko
arguments, related to caching etc, are like this:
--single-snapshot --snapshot-mode=redo --cache=true --cache-copy-layers=false --cache-ttl=24h --use-new-run
@cdprete have you noticed any difference without --use-new-run
?
Not at all.
Il mer 19 giu 2024, 22:58 Filip M @.***> ha scritto:
@cdprete https://github.com/cdprete have you noticed any difference without --use-new-run?
— Reply to this email directly, view it on GitHub https://github.com/GoogleContainerTools/kaniko/issues/3215#issuecomment-2179448895, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAZGWF4UVWQKN7WUZHE563ZIHWITAVCNFSM6AAAAABJPTQEUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGQ2DQOBZGU . You are receiving this because you were mentioned.Message ID: @.***>
@FilDevTronic does for you --snapshot-mode
work?
I see it being ignored as well for me: https://github.com/GoogleContainerTools/kaniko/issues/3233
I can confirm that the flags
--single-snapshot
,
--use-new-run
,
--snapshot-mode=redo
have no impact on the build snapshotting each layer.
Hello. I've a GitLab job like the following:
and from the output I can see that multiple snapshots are created, even if
--single-snapshot
is specified:The Dockerfile is just