-
-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (32 loc) · 1.12 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Docker build and container scan
on:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker build
run: |
docker build . --file ./distribution/docker-images/ci.Dockerfile --tag containerscanner:${{ github.sha }}
- name: Anchore scan
uses: anchore/[email protected]
with:
image-reference: containerscanner:${{ github.sha }}
dockerfile-path: ./distribution/docker-images/dev.Dockerfile
include-app-packages: true
fail-build: true # no idea why it doesn't work
- name: Show Anchore results
run: for j in `ls ./anchore-reports/*.json`; do echo "---- ${j} ----"; cat ${j}; echo; done
if: ${{ always() }}
- name: Upload Anchore results
uses: actions/upload-artifact@v2
with:
name: anchore-reports
path: ./anchore-reports/
if: ${{ always() }}
- name: Fail on any vulnerability
run: jq -e '.vulnerabilities | any( . ) | not' anchore-reports/vulnerabilities.json