Switched from a Dockerfile "ADD" command to wget for the BusyBox source
tarball because, surprisingly, [https://github.com/moby/moby/issues/12361 |
BuildKit pulls the URL unconditionally] under the logic that it can't
know whether to cache the pulled data until it has a copy to compare
against! This not only means you pull the BusyBox source tarball for
each container build even though it's tagged and thus cannot possibly
change, it puts a load on GitHub which then causes it to begin
throttling each pull, making your local builds slower and slower when
iterating on a change set, as in the prior set of commits. By pushing
the URL down into a wget command, we cause BuildKit to see an unchanging
shell script line (assuming $BBXURL keeps its default) so it *does*
cache the pulled layer.