CircleCI pushing to Google Container Registry

Hi,

I’m looking for some advise as to how I can speed up a push to Google Container Registry in my deployments.

Its taking 10-15 mins per push.

@anon52070816 do you have any ideas? I know you have worked with GCE a lot in the past.

How long does it take if you were to do it locally, also do you mind pasting the deployment section of your circle.yml here?

This has been annoying for a while… but it looks like some improvement may have been made with https://github.com/docker/docker/pull/19109. The issue has been that with docker registry v2, the daemon has to “re-push” all image layers to the registry so that their checksums can be verified even if the registry being pushed to should already know about them. It’s not so bad with a single long-running docker daemon (as on a local machine) because there’s some cache (in-memory I believe) that stores signed pointers or something to the layers in the target registry, but on CircleCI you get a fresh daemon instance every time. IIRC the “cross repository push” feature alleviates this by telling the target registry to recognize e.g. the trusty base image from hub.docker.com when it sees it and not need to have the layers re-pushed every time.

There’s some more relevant info at:



The fix is pretty new, and I’m not actually sure if it Just Works ™ with Docker 1.10 or if it requires some special config on the pushing daemon or the target registry. You can try using 1.10, do a couple builds (make sure to get at least a couple successful pushes because I think there may still be some cacheing to do) and see if it helps. Note though that docker save/load don’t work as they used to with 1.10, so that could be problematic if you rely on those.

1 Like