best practice on avoid using cache images with build args

2,115 views
Skip to first unread message

Ke Zhu

unread,
May 10, 2021, 10:23:20 AM5/10/21
to skaffol...@googlegroups.com
The problem is only appears when using a dockerfile with build stages
from a git module. when passing build args over skaffold.yaml, the
revision didn't change, so it either caches old image locally without
building it, or the image is cached on k8s cluster since the tag is not
changed.

What's the best practice on resolving above problem?

Nick Kubala

unread,
May 11, 2021, 2:19:31 PM5/11/21
to Ke Zhu, skaffol...@googlegroups.com
Does the `--cache-artifacts=false` flag not avoid the image being cached locally? This won't bypass docker's build cache but it will skip Skaffold's image artifact cache. Otherwise the `--no-cache` flag passed as a build arg in your docker build config in your skaffold.yaml should skip docker's build cache, though if that isn't being respected then we might need to open an issue.

--
You received this message because you are subscribed to the Google Groups "skaffold-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skaffold-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skaffold-users/be7594216856471b920ee6c1f05f04e9440f1c91.camel%40us.ibm.com.

Ke Z

unread,
Jun 15, 2021, 9:22:30 AM6/15/21
to skaffold-users
Thanks for the reply!

I will try `--cache-artifacts=false` so that it should work on build severs. I'm going to try `ARG CACHE_BUST` in Dockerfile to see if I can bypass docker build cache.

Reply all
Reply to author
Forward
0 new messages