Goal: Be able to use docker build caches across agents
Context: I use a buildkite pipeline to run parallel tests on 5-10 agents for some rspec tests. I use docker-compose to bring up my main app and it’s dependencies. Not sure what the right terminology is but we use temporary agents (they get removed when not used, and we get new ones when demand increases). I seem to get cache hits on the existing agents but the new ones that gets created on demand doesnt seem to have those caches to be used.
Questions 1: How can i make sure any agent (new or existing) can use these layer caches? Any examples you can point me at?
Question 2: Should I be thinking of a different strategy building/using docker images when building my pipelines?