Skip to content

Commit

Permalink
Preload Trivy DB
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
WyriHaximus committed Nov 15, 2024
1 parent 880fc9d commit 053fe78
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ jobs:
image: ${{ steps.image-matrix.outputs.image }}
steps:
- uses: actions/checkout@v4
- name: Preload Trivy DB
uses: nick-invision/retry@v3
with:
timeout_minutes: 120
retry_wait_seconds: 1
max_attempts: 13
command: docker pull "ghcr.io/aquasecurity/trivy-db:2"
- id: image-matrix
name: Generate Combined Image Matrix
run: |
Expand Down
2 changes: 1 addition & 1 deletion test-nts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ docker run --rm -t \
renatomefi/docker-testinfra:5 \
-m "$TEST_SUITE" --junitxml="/results/php-nts-$DOCKER_TAG.xml" \
--disable-pytest-warnings \
--verbose --hosts="docker://$DOCKER_CONTAINER"
--verbose --hosts="docker://$DOCKER_CONTAINER"
2 changes: 1 addition & 1 deletion test-zts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ docker run --rm -t \
renatomefi/docker-testinfra:5 \
-m "$TEST_SUITE" --junitxml="/results/php-zts-$DOCKER_TAG.xml" \
--disable-pytest-warnings \
--verbose --hosts="docker://$DOCKER_CONTAINER"
--verbose --hosts="docker://$DOCKER_CONTAINER"

0 comments on commit 053fe78

Please sign in to comment.