File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change 10
10
- ' v2'
11
11
tags :
12
12
- ' v*'
13
- workflow_dispatch :
14
13
15
14
permissions :
16
15
contents : read # to fetch code (actions/checkout)
17
16
17
+ env :
18
+ REPO_SLUG : " docker/compose-bin"
19
+
18
20
jobs :
19
21
e2e :
20
22
name : Build and test
72
74
run : |
73
75
make e2e-compose-standalone
74
76
77
+ bin-image :
78
+ runs-on : ubuntu-22.04
79
+ steps :
80
+ -
81
+ name : Checkout
82
+ uses : actions/checkout@v3
83
+ -
84
+ name : Set up QEMU
85
+ uses : docker/setup-qemu-action@v2
86
+ -
87
+ name : Set up Docker Buildx
88
+ uses : docker/setup-buildx-action@v2
89
+ -
90
+ name : Docker meta
91
+ id : meta
92
+ uses : docker/metadata-action@v4
93
+ with :
94
+ images : |
95
+ ${{ env.REPO_SLUG }}
96
+ tags : |
97
+ type=ref,event=tag
98
+ type=edge
99
+ bake-target : meta-helper
100
+ -
101
+ name : Login to DockerHub
102
+ if : github.event_name != 'pull_request'
103
+ uses : docker/login-action@v2
104
+ with :
105
+ username : ${{ secrets.DOCKERPUBLICBOT_USERNAME }}
106
+ password : ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
107
+ -
108
+ name : Build and push image
109
+ uses : docker/bake-action@v2
110
+ with :
111
+ files : |
112
+ ./docker-bake.hcl
113
+ ${{ steps.meta.outputs.bake-file }}
114
+ targets : image-cross
115
+ push : ${{ github.event_name != 'pull_request' }}
116
+ set : |
117
+ *.cache-from=type=gha,scope=bin-image
118
+ *.cache-to=type=gha,scope=bin-image,mode=max
119
+ *.attest=type=sbom
120
+ *.attest=type=provenance,mode=max,builder-id=https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}
Original file line number Diff line number Diff line change @@ -168,6 +168,8 @@ FROM binary-unix AS binary-linux
168
168
FROM scratch AS binary-windows
169
169
COPY --link --from=build /usr/bin/docker-compose /docker-compose.exe
170
170
FROM binary-$TARGETOS AS binary
171
+ # enable scanning for this stage
172
+ ARG BUILDKIT_SBOM_SCAN_STAGE=true
171
173
172
174
FROM --platform=$BUILDPLATFORM alpine AS releaser
173
175
WORKDIR /work
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ function "bindir" {
33
33
result = DESTDIR != " " ? DESTDIR : " ./bin/${ defaultdir } "
34
34
}
35
35
36
+ # Special target: https://github.com/docker/metadata-action#bake-definition
37
+ target "meta-helper" {}
38
+
36
39
target "_common" {
37
40
args = {
38
41
GO_VERSION = GO_VERSION
@@ -134,3 +137,8 @@ target "docs-update" {
134
137
target = " docs-update"
135
138
output = [" ./docs" ]
136
139
}
140
+
141
+ target "image-cross" {
142
+ inherits = [" meta-helper" , " binary-cross" ]
143
+ output = [" type=image" ]
144
+ }
You can’t perform that action at this time.
0 commit comments