Skip to content

Commit 888e977

Browse files
committed
travis: save docker images on local cache
The recently introduced rate limits on Docker Hub are constantly being reached by every TravisCI because each individual job that creates a MySQL container, tries to pull the base image from Docker Hub. With a not-so-small test matrix, this issue surfaces pretty fast. This patch introduces a local cache to save docker images and be able to re-use them on different jobs and avoid constantly pulling them from Docker Hub.
1 parent cd61d7b commit 888e977

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This file was modified by Oracle on June 14, 2021.
2+
# The changes involve the introduction of a local cache for Docker images.
3+
# Modifications copyright (c) 2021, Oracle and/or its affiliates.
4+
15
sudo: required
26
dist: trusty
37

@@ -9,9 +13,19 @@ language: node_js
913
cache:
1014
yarn: true
1115
directories:
16+
- docker_images
1217
- node_modules
1318
- $HOME/.yarn-cache
1419

20+
before_cache:
21+
# save all docker images to a local cache in order to avoid the rate limit
22+
# on Docker Hub
23+
- docker save -o docker_images/images.tar $(docker images -a -q)
24+
25+
before_install:
26+
# load docker images from the local cache
27+
- docker load -i docker_images/images.tar || true
28+
1529
# Node.js version:
1630
# we test only maintained LTS versions
1731
# and lastest dev version

0 commit comments

Comments
 (0)