File tree Expand file tree Collapse file tree 4 files changed +12
-88
lines changed Expand file tree Collapse file tree 4 files changed +12
-88
lines changed Original file line number Diff line number Diff line change 11prefix =/usr/local
22bindir =$(prefix ) /bin
33
4+ ifneq (, $(BUILDX_BIN ) )
5+ export BUILDX_CMD = $(BUILDX_BIN)
6+ else ifneq (, $(shell docker buildx version))
7+ export BUILDX_CMD = docker buildx
8+ else ifneq (, $(shell command -v buildx))
9+ export BUILDX_CMD = $(command -v buildx)
10+ endif
11+
412export BUILDX_CMD ?= docker buildx
513
614.PHONY : binaries
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
3+ : " ${BUILDX_CMD=docker buildx} "
4+
35: " ${CI=} "
46: " ${GITHUB_ACTIONS=} "
57: " ${GITHUB_REPOSITORY=} "
@@ -15,32 +17,15 @@ if [ "$CI" = "true" ]; then
1517 progressFlag=" --progress=plain"
1618fi
1719
18- buildxBin=" "
19- builderName=" "
20- if docker buildx version > /dev/null 2>&1 ; then
21- buildxBin=" docker buildx"
22- elif buildx version > /dev/null 2>&1 ; then
23- buildxBin=" buildx"
24- else
25- topdir=" $( realpath $( dirname " $0 " ) /..) "
26- if [ ! -x " ${topdir} /bin/buildx" ]; then
27- set -x
28- " ${topdir} /hack/install-buildx"
29- fi
30- buildxBin=" ${topdir} /bin/buildx"
31- builderName=" moby-buildkit"
32- " ${topdir} /hack/bootstrap-buildx" " ${builderName} "
33- fi
34-
3520buildxCmd () {
3621 (
3722 set -x
38- BUILDX_NO_DEFAULT_LOAD=true BUILDX_BUILDER=" ${builderName :- ${ BUILDX_BUILDER}} " $buildxBin " $@ " $progressFlag
23+ BUILDX_NO_DEFAULT_LOAD=true BUILDX_BUILDER=" ${BUILDX_BUILDER} " ${BUILDX_CMD} " $@ " $progressFlag
3924 )
4025}
4126
4227buildAttestFlags () {
43- if $buildxBin build --help 2>&1 | grep -- ' --attest' > /dev/null; then
28+ if ${BUILDX_CMD} build --help 2>&1 | grep -- ' --attest' > /dev/null; then
4429 prvattrs=" mode=max"
4530 if [ " $GITHUB_ACTIONS " = " true" ]; then
4631 prvattrs=" $prvattrs ,builder-id=https://github.com/${GITHUB_REPOSITORY} /actions/runs/${GITHUB_RUN_ID} "
You can’t perform that action at this time.
0 commit comments