diff mbox series

[1/1] travis: Add Docker Hub pull rate limit workaround

Message ID 20210415125630.9672-1-pvorel@suse.cz (mailing list archive)
State New, archived
Headers show
Series [1/1] travis: Add Docker Hub pull rate limit workaround | expand

Commit Message

Petr Vorel April 15, 2021, 12:56 p.m. UTC
Use mirror.gcr.io mirror for Docker to workaround pull rate limit in
docker registry to avoid common error:
anyrequests: You have reached your pull rate limit.

This still sometimes use docker registry, which can leads to occasional
failures, but less often.

Correct solution would be to migrate to Github Actions.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi Mimi,

this expects to be applied after my 2 previous fixes ("travis: Fix
openSUSE Tumbleweed" and "tests/install-swtpm.sh: Add tar option
--no-same-owner"):
https://patchwork.kernel.org/project/linux-integrity/list/?series=467745&state=*

Tested:
https://travis-ci.org/github/pevik/ima-evm-utils/builds/767149815

Kind regards,
Petr

 .travis.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index ac6b2a5..e96e52a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -84,6 +84,17 @@  before_install:
             sudo curl -L https://github.com/opencontainers/runc/releases/download/v1.0.0-rc93/runc.amd64 -o /usr/bin/runc
             sudo chmod +x /usr/bin/runc
         fi
+
+    # Docker Hub pull rate limit workaround for docker
+    - >
+        if [ "$CONTAINER" = "docker" ]; then
+            conf="/etc/docker/daemon.json"
+            tmp=$(mktemp)
+            sudo jq '."registry-mirrors" += ["https://mirror.gcr.io"]' $conf > $tmp
+            sudo mv $tmp $conf
+            sudo systemctl daemon-reload
+            sudo systemctl restart docker
+        fi
     - $CONTAINER info
 
     - DIR="/usr/src/ima-evm-utils"