Docker Community Forums

Share and learn in the Docker community.

Building with N+1 Dockerfiles at the same time, cache is invalidated


(Phunky) #1

This might be solved with the new upcoming feature “build cache”, but would ask this here anyway.

We have a set of (almost, some var values are different) identical Dockerfiles being built at the same time: (Node-6 slim based)

  1. Dockerfile A: Starts to build, no cache
  2. Dockerfile B: Starts to build, no cache
  3. Dockerfile A: Starts SUT, cache
  4. Dockerfile B: Starts SUT, no cache

Step 3 and 4 is alternated from time to time, depending on which came first, but it seems like the cache is invalidated.

Do we have to wait for the “build cache” feature to fix this? ATM we are at approx 10-40 minute build time for Dockerfile A and 15-60 minute build time, which becomes a bit unbearable. (the main culprit of the build could be the npm install/yarn)