CircleCI

  1. $ cat .circleci/config.yml
  2. jobs:
  3. build:
  4. docker:
  5. - image: docker:stable-git
  6. steps:
  7. - checkout
  8. - setup_remote_docker
  9. - run:
  10. name: Build image
  11. command: docker build -t trivy-ci-test:${CIRCLE_SHA1} .
  12. - run:
  13. name: Install trivy
  14. command: |
  15. apk add --update-cache --upgrade curl
  16. curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
  17. - run:
  18. name: Scan the local image with trivy
  19. command: trivy --exit-code 0 --no-progress trivy-ci-test:${CIRCLE_SHA1}
  20. workflows:
  21. version: 2
  22. release:
  23. jobs:
  24. - build

Example Repository