I have a container that builds an app. The Git source tree is in Windows outside the container, about 3k files, 290Mb (most of that in a single file in the .git directory). The container has a bind mount to the source tree, and a bind mount to the output directory where the .war files go.
On container start, the entry point script copies the source tree into the container using something along the lines of tar cf - | ( cd /blah/inside && tar xf - )
from the /blah/outside directory, then it runs Maven to do the build, and uses simple cp
to spit the .war files out to the other bind mount.
The copy from the source into the container often takes less than 10 seconds. Sometimes it takes over 40 seconds.
It seems to be the first build of the day, and if I leave the build tool alone for more than half an hour.
Maven always takes 15-20 seconds to do the build.
Is there any way of speeding this up, or at the least, making it a little more predictable?
Thanks