Merge pull request #1846 from AkihiroSuda/remove-unused-buildmode

hack/util: remove unused buildmode
v0.8
Tõnis Tiigi 2020-11-25 21:26:19 -08:00 committed by GitHub
commit 90104d287d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 23 deletions

View File

@ -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

View File

@ -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