Skip to content

Commit

Permalink
travis: save docker images on local cache
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ruiquelhas committed Jun 16, 2021
1 parent cd61d7b commit 888e977
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This file was modified by Oracle on June 14, 2021.
# The changes involve the introduction of a local cache for Docker images.
# Modifications copyright (c) 2021, Oracle and/or its affiliates.

sudo: required
dist: trusty

Expand All @@ -9,9 +13,19 @@ language: node_js
cache:
yarn: true
directories:
- docker_images
- node_modules
- $HOME/.yarn-cache

before_cache:
# save all docker images to a local cache in order to avoid the rate limit
# on Docker Hub
- docker save -o docker_images/images.tar $(docker images -a -q)

before_install:
# load docker images from the local cache
- docker load -i docker_images/images.tar || true

# Node.js version:
# we test only maintained LTS versions
# and lastest dev version
Expand Down

0 comments on commit 888e977

Please sign in to comment.