When I run docker build on a image, the first thing it does is
=> [internal] load metadata for docker.io/x/y
for each of the images that I depend on and haven’t built locally.
I am on a satellite and this takes between 15 seconds and 30 seconds every time… and I’m constantly rebuilding and testing… and I know that nothing has changed.
None of the options on docker build seem to be related to turning this off. I would really like a way to either
(A) Turn this off with docker build --dont-look-at-registry on a per-run basis
(B) Have it cached with a configured TTL, so it won’t check more than once every X minutes/hours/days/etc
Is there a way to do either of these or otherwise work around this?
I would love this! Ran into this when on an airplane yesterday, I couldn’t run “docker build” at all even though I had just changed some local files, and the base image was definitely in my cache. It just errors out when it can’t connect…
I forget where I learned this, but you can delete the credsStore entry from ~/.docker/config.json and it should speed things up. Not sure why this happens, but I am constantly deleting that value… which is occasionally put back by docker somehow… not sure how or when.