16
16
jobs :
17
17
build :
18
18
runs-on : ubuntu-latest
19
+ strategy :
20
+ matrix :
21
+ image : ["3.17", "3.19", "3.20"]
22
+ openssl_version : ["3.0.9"]
19
23
steps :
20
24
- name : Checkout Repository
21
25
uses : actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
22
26
23
- - name : Get Alpine version
24
- id : alpine
25
- run : echo "version=$(grep -m1 'FROM alpine' <Dockerfile | awk -F'[:]' '{print $2}')" >> $GITHUB_OUTPUT
26
-
27
27
- name : Docker Buildx
28
28
uses : docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
29
29
52
52
type=ref,event=pr
53
53
type=semver,pattern={{version}}
54
54
type=semver,pattern={{major}}.{{minor}}
55
- type=semver,pattern={{version}},suffix=-alpine${{ steps.alpine.outputs.version }}
55
+ type=semver,pattern={{version}},suffix=-alpine${{ matrix.image }}
56
56
env :
57
57
DOCKER_METADATA_ANNOTATIONS_LEVELS : manifest,index
58
58
@@ -62,23 +62,27 @@ jobs:
62
62
with :
63
63
file : Dockerfile
64
64
context : " ."
65
- cache-from : type=gha,scope=alpine
66
- cache-to : type=gha,scope=alpine,mode=max
65
+ cache-from : type=gha,scope=alpine${{ matrix.image }}
66
+ cache-to : type=gha,scope=alpine${{ matrix.image }} ,mode=max
67
67
tags : ${{ steps.meta.outputs.tags }}
68
68
load : ${{ github.event_name == 'pull_request' }}
69
69
push : ${{ github.event_name != 'pull_request' }}
70
70
platforms : ${{ github.event_name != 'pull_request' && env.platforms || '' }}
71
71
annotations : ${{ github.event_name != 'pull_request' && steps.meta.outputs.annotations || '' }}
72
+ target : alpine
72
73
pull : true
73
74
sbom : ${{ github.event_name != 'pull_request' }}
74
75
provenance : ${{ github.event_name != 'pull_request' }}
76
+ build-args : |
77
+ BUILD_OS=alpine:${{ matrix.image }}
78
+ OPENSSL_VERSION=${{ matrix.openssl_version }}
75
79
76
80
- name : Run Grype vulnerability scanner
77
81
uses : anchore/scan-action@3343887d815d7b07465f6fdcd395bd66508d486a # v3.6.4
78
82
continue-on-error : true
79
83
id : scan
80
84
with :
81
- image : ghcr.io/nginxinc/alpine-fips:${{ steps.meta.outputs.version }}
85
+ image : ghcr.io/nginxinc/alpine-fips:${{ steps.meta.outputs.version }}-alpine${{ matrix.image }}
82
86
only-fixed : true
83
87
add-cpes-if-none : true
84
88
0 commit comments