--cache-ttl seems doesn't work
Actual behavior A clear and concise description of what the bug is. I set --cache-ttl=8760h, which is about one year. but Kaniko shows cannot find from cache when I build in the second day for the same project no any changes. what's max value for --cache-ttl ?
Expected behavior A clear and concise description of what you expected to happen.
To Reproduce Steps to reproduce the behavior:
- ...
- ...
Additional Information
- Dockerfile Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
- Build Context Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
- Kaniko Image (fully qualified with digest)
Triage Notes for the Maintainers
| Description | Yes/No |
|---|---|
| Please check if this a new feature you are proposing |
|
| Please check if the build works in docker but not in kaniko |
|
Please check if this error is seen when you use --cache flag |
|
| Please check if your dockerfile is a multistage dockerfile |
|
@Sherman-Yang --cache-ttl is a time.Duration so its resolution is the same as int64
https://github.com/GoogleContainerTools/kaniko/blob/v0.14.0/cmd/executor/cmd/root.go#L144 https://github.com/GoogleContainerTools/kaniko/blob/v0.14.0/pkg/config/options.go#L26
thank you @cvgw. I find it --cache-ttl works. just sometimes, the hash value is different. so Kaniko cannot find the cache. don't know Kaniko calculate the hash value
@Sherman-Chata yes, that's correct. There are a few open bugs around caching at the moment. There are some PRs in review to address them so hopefully will be fixed soon.
Please let me know if there is anything else I can do to help
@Sherman-Chata can you give this another try with v0.15.0?
@cvgw v1.16.0 seems to be broken, we set -cache-ttl=168h , but it still fails to find cache