Skip to content

Commit 053fe78

Browse files
committed
Preload Trivy DB
GitHub's container registry has implemented some rate limiting, this will try to load the database 13 times before running Trivy. For the past few weeks almost every single image build failed due to this and it takes a dozen retries easily to get all scans to pass.
1 parent 880fc9d commit 053fe78

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ jobs:
7575
image: ${{ steps.image-matrix.outputs.image }}
7676
steps:
7777
- uses: actions/checkout@v4
78+
- name: Preload Trivy DB
79+
uses: nick-invision/retry@v3
80+
with:
81+
timeout_minutes: 120
82+
retry_wait_seconds: 1
83+
max_attempts: 13
84+
command: docker pull "ghcr.io/aquasecurity/trivy-db:2"
7885
- id: image-matrix
7986
name: Generate Combined Image Matrix
8087
run: |

test-nts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ docker run --rm -t \
5858
renatomefi/docker-testinfra:5 \
5959
-m "$TEST_SUITE" --junitxml="/results/php-nts-$DOCKER_TAG.xml" \
6060
--disable-pytest-warnings \
61-
--verbose --hosts="docker://$DOCKER_CONTAINER"
61+
--verbose --hosts="docker://$DOCKER_CONTAINER"

test-zts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ docker run --rm -t \
5858
renatomefi/docker-testinfra:5 \
5959
-m "$TEST_SUITE" --junitxml="/results/php-zts-$DOCKER_TAG.xml" \
6060
--disable-pytest-warnings \
61-
--verbose --hosts="docker://$DOCKER_CONTAINER"
61+
--verbose --hosts="docker://$DOCKER_CONTAINER"

0 commit comments

Comments
 (0)