Skip to content

Commit 97f65dd

Browse files
authored
fix(sbom): support required docker buildx customization (#173)
1 parent 8586ab4 commit 97f65dd

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Task/Taskfile.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ tasks:
170170
OUTPUT_FILE: '{{.IMAGE_NAME | replace "/" "_"}}_{{.BUILD_VERSION}}_{{.PLATFORM | replace "/" "_" | replace "," "_"}}.tar'
171171
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
172172
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT | default "."}}'
173+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
173174
cmds:
174175
# We only load when the provided platform equals the detected local platform. This is for two reasons:
175176
# 1. We assume you don't want to load a cross-platform build
@@ -255,6 +256,7 @@ tasks:
255256
VERSION: '{{.VERSION}}'
256257
PLATFORM: '{{.PLATFORM | default .LOCAL_PLATFORM}}'
257258
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
259+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
258260
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
259261

260262
update:
@@ -349,6 +351,8 @@ tasks:
349351
# This is necessary in order to have a separate tag per platform, and ensure there is only one manifest in the image index due to current
350352
# syft/stereoscope limitations
351353
DOCKER_BUILDX_CUSTOM_TAGS: '--tag {{.IMAGE_AND_TAG}}-{{.platform | replace "/" "_"}}'
354+
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
355+
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
352356
- for:
353357
var: PLATFORM
354358
split: ','

Task/bash/Taskfile.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ tasks:
4343
VERSION: '{{.VERSION}}'
4444
PLATFORM: '{{.PLATFORM}}'
4545
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
46+
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
47+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
4648

4749
update:
4850
desc: >
@@ -68,6 +70,7 @@ tasks:
6870
PLATFORM: '{{.PLATFORM}}'
6971
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
7072
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
73+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
7174

7275
clean:
7376
desc: Clean up build artifacts, cache files/directories, temp files, etc.
@@ -78,6 +81,10 @@ tasks:
7881
desc: Generate project SBOMs
7982
cmds:
8083
- task: base:sbom
84+
vars:
85+
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
86+
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
87+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
8188

8289
vulnscan:
8390
desc: Vuln scan the SBOM

Task/python/Taskfile.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ tasks:
4949
sh: pipenv run python -c 'from {{.PROJECT_SLUG}} import __version__; print(__version__)'
5050
PLATFORM: '{{.PLATFORM}}'
5151
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
52+
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
53+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
5254

5355
update:
5456
desc: >
@@ -74,6 +76,7 @@ tasks:
7476
PLATFORM: '{{.PLATFORM}}'
7577
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
7678
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
79+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
7780

7881
clean:
7982
desc: Clean up build artifacts, cache files/directories, temp files, etc.
@@ -86,6 +89,10 @@ tasks:
8689
desc: Generate project SBOMs
8790
cmds:
8891
- task: base:sbom
92+
vars:
93+
DOCKER_BUILDX_CUSTOM_ARGS: '{{.DOCKER_BUILDX_CUSTOM_ARGS | default ""}}'
94+
DOCKER_BUILDX_CUSTOM_CONTEXT: '{{.DOCKER_BUILDX_CUSTOM_CONTEXT}}'
95+
DOCKER_BUILDX_CUSTOM_TAGS: '{{.DOCKER_BUILDX_CUSTOM_TAGS | default ""}}'
8996

9097
vulnscan:
9198
desc: Vuln scan the SBOM

0 commit comments

Comments
 (0)