Created
February 3, 2021 11:05
-
-
Save axelpavageau/d10d657a2afd40faeb536142dc443687 to your computer and use it in GitHub Desktop.
sample dind pipeline with trivy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- test | |
trivy: | |
stage: test | |
image: ekino/ci-dind:latest | |
services: | |
- name: docker:dind | |
entrypoint: ["env", "-u", "DOCKER_HOST"] | |
command: ["dockerd-entrypoint.sh"] | |
variables: | |
DOCKER_HOST: tcp://docker:2375/ | |
DOCKER_DRIVER: overlay2 | |
DOCKER_TLS_CERTDIR: "" | |
IMAGE: trivy-ci-test:$CI_COMMIT_SHA | |
script: | |
# Build image | |
- docker build -t $IMAGE . | |
# Print report | |
- trivy --exit-code 0 --cache-dir .trivycache/ --no-progress --severity HIGH $IMAGE | |
# Fail on severe vulnerabilities | |
- trivy --exit-code 1 --cache-dir .trivycache/ --severity CRITICAL --no-progress $IMAGE | |
cache: | |
paths: | |
- .trivycache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment