Merge pull request #1846 from AkihiroSuda/remove-unused-buildmode
hack/util: remove unused buildmodev0.8
commit
90104d287d
|
@ -6,7 +6,6 @@ env:
|
|||
- DOCKER_CHANNEL="stable"
|
||||
- DOCKER_CLI_EXPERIMENTAL="enabled"
|
||||
- PLATFORMS="linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le"
|
||||
- PREFER_BUILDCTL="1"
|
||||
|
||||
before_install:
|
||||
# update docker
|
||||
|
|
30
hack/util
30
hack/util
|
@ -5,37 +5,23 @@ export BUILDX_NO_DEFAULT_LOAD=true
|
|||
: ${PREFER_LEGACY=}
|
||||
: ${CI=}
|
||||
: ${GITHUB_ACTIONS=}
|
||||
: ${DOCKER_BUILDKIT=}
|
||||
: ${TRAVIS_EVENT_TYPE=}
|
||||
: ${TRAVIS_BRANCH=}
|
||||
: ${CACHE_DIR=}
|
||||
|
||||
if [ "$PREFER_BUILDCTL" = "1" ]; then
|
||||
echo >&2 "WARNING: PREFER_BUILDCTL is no longer supported. Ignoring."
|
||||
fi
|
||||
|
||||
if [ "$PREFER_LEGACY" = "1" ]; then
|
||||
echo >&2 "WARNING: PREFER_LEGACY is no longer supported. Ignoring."
|
||||
fi
|
||||
|
||||
progressFlag=""
|
||||
if [ "$CI" = "true" ]; then
|
||||
progressFlag="--progress=plain"
|
||||
fi
|
||||
|
||||
newerEqualThan() { # $1=minimum wanted version $2=actual-version
|
||||
[ "$1" = "$(printf "$1\n$2" | sort -V | head -n 1)" ]
|
||||
}
|
||||
|
||||
buildmode="legacy"
|
||||
if [ "$PREFER_BUILDCTL" = "1" ]; then
|
||||
buildmode="buildkit"
|
||||
else
|
||||
serverVersion=$(docker info --format '{{.ServerVersion}}')
|
||||
experimental=$(docker info --format '{{.ExperimentalBuild}}')
|
||||
if [ "$PREFER_LEGACY" != "1" ] && (newerEqualThan "18.09" $serverVersion ||
|
||||
(newerEqualThan "18.06" $serverVersion && [ "true" = "$experimental" ]) ||
|
||||
[ "$DOCKER_BUILDKIT" = "1" ]); then
|
||||
buildmode="docker-buildkit"
|
||||
fi
|
||||
fi
|
||||
if [ "$buildmode" = "legacy" ]; then
|
||||
echo >&2 "ERROR: \"legacy\" buildmode is no longer supported. Please enable DOCKER_BUILDKIT or install standalone BuildKit"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
buildxCmd() {
|
||||
if docker buildx version >/dev/null 2>&1; then
|
||||
set -x
|
||||
|
|
Loading…
Reference in New Issue