Skip to content

Commit

Permalink
jankfest buildx
Browse files Browse the repository at this point in the history
Signed-off-by: Connor Catlett <conncatl@amazon.com>
  • Loading branch information
ConnorJC3 committed Jan 24, 2023
1 parent 5483e28 commit 9cfe524
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions hack/provenance
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@
# in installations of buildx that do not correctly report their version
# via `docker buildx version`.
#
# Additionally, specifying --provenance=false will FAIL when using too
# old of a version of buildkitd. Specifying no attestation-related
# arguments will magically make buildx understand you don't want any
# attestation (but if and only if the local buildkitd doesn't support it,
# otherwise attestation will be used). Thus, this script also checks if
# buildkitd is before version 0.11.0
#
# Thus, this script echos back the flag `--provenance=false` if and only
# if the local buildx installation supports it. If not, it exits silently.
# if the local buildx and buildkitd installation supports it. If not,
# it exits silently.

BUILDX_TEST=`docker buildx build --provenance=false 2>&1`
if [[ "${BUILDX_TEST}" == *"See 'docker buildx build --help'."* ]]; then
if [[ "${BUILDX_TEST}" == *"requires exactly 1 argument"* ]]; then
echo "--provenance=false"
if ! docker buildx ls | grep -qE 'v0\.([0-9]|10)\.'; then
echo "--provenance=false"
fi
fi
else
echo "Local buildx installation broken?" >&2
Expand Down

0 comments on commit 9cfe524

Please sign in to comment.