Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kaniko with Remote ECR repo for --cache-repo #3089

Open
sushama-kothawale opened this issue Mar 26, 2024 · 3 comments
Open

Kaniko with Remote ECR repo for --cache-repo #3089

sushama-kothawale opened this issue Mar 26, 2024 · 3 comments
Labels
area/caching For all bugs related to cache issues kind/feature-request priority/p1 Basic need feature compatibility with docker build. we should be working on this next. registry/ecr

Comments

@sushama-kothawale
Copy link

This is related to Kaniko do not use cache options

When we set --cache-repo as ECR repo url, kaniko push all layers to ecr repo as cache, if dockerfile has too many/multi-step instructions, this increases the ECR repo storage size. And for each build it pushes the cache to ecr repo. Can we have option like if layer cache is present in ECR repo then use that cache while building the image and do not push it again?

I am using below options to build image with kaniko:

docker run gcr.io/kaniko-project/executor:latest --context=/workspace/build --dockerfile=/workspace/build/{dockerfile} --destination={image_tag_version} --cache=true --cache-repo=84592232.dkr.ecr.ap-south-1.amazonaws.com/dev-builds --use-new-run --cache-run-layers --cache-copy-layers --snapshot-mode=redo --cleanup --verbosity=info --log-timestamp

our build requirement is daily 20-30 build of different code languages.. ECR has the storage limit of 10000 tags for each repo. So limit exceeds within 2-3 days.

Can someone check this?

@QuanZhang-William QuanZhang-William added registry/ecr area/caching For all bugs related to cache issues kind/feature-request priority/p1 Basic need feature compatibility with docker build. we should be working on this next. labels Mar 27, 2024
@sushama-kothawale
Copy link
Author

sushama-kothawale commented Apr 1, 2024

@jaugustin @aaron-prindle @JeromeJu
@QuanZhang-William It seems you marked this as feature request? Can you please confirm if this is the case? or any argument I need to pass while docker run command to achieve the same?

@sushama-kothawale
Copy link
Author

@QuanZhang-William any updates on this? We are blocked on this for integrating kaniko with our prod builds..

@mzihlmann
Copy link

mzihlmann commented Oct 15, 2024

could you verify you're not running into this issue?
#3340

with --cache only RUN instructions are cached. with cache-copy-layers only COPY instructions are cached. So layers created by WORKDIR or ADD will cause cache misses. This is not easily noticeable when doing single stage builds, but pops up clearly when doing multistage ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/caching For all bugs related to cache issues kind/feature-request priority/p1 Basic need feature compatibility with docker build. we should be working on this next. registry/ecr
Projects
None yet
Development

No branches or pull requests

3 participants