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 1
1
prefix =/usr/local
2
2
bindir =$(prefix ) /bin
3
3
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
+
4
12
export BUILDX_CMD ?= docker buildx
5
13
6
14
.PHONY : binaries
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env sh
2
2
3
+ : " ${BUILDX_CMD=docker buildx} "
4
+
3
5
: " ${CI=} "
4
6
: " ${GITHUB_ACTIONS=} "
5
7
: " ${GITHUB_REPOSITORY=} "
@@ -15,32 +17,15 @@ if [ "$CI" = "true" ]; then
15
17
progressFlag=" --progress=plain"
16
18
fi
17
19
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
-
35
20
buildxCmd () {
36
21
(
37
22
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
39
24
)
40
25
}
41
26
42
27
buildAttestFlags () {
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
44
29
prvattrs=" mode=max"
45
30
if [ " $GITHUB_ACTIONS " = " true" ]; then
46
31
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