kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

--cache-ttl seems doesn't work

Open ghost opened this issue 7 years ago • 5 comments

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:

  1. ...
  2. ...

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
  • - [ ]

ghost avatar Nov 29 '19 23:11 ghost

@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

cvgw avatar Dec 02 '19 17:12 cvgw

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-yang avatar Dec 03 '19 16:12 sherman-yang

@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

cvgw avatar Dec 03 '19 16:12 cvgw

@Sherman-Chata can you give this another try with v0.15.0?

cvgw avatar Dec 20 '19 19:12 cvgw

@cvgw v1.16.0 seems to be broken, we set -cache-ttl=168h , but it still fails to find cache

ypadlyak avatar Feb 04 '20 14:02 ypadlyak