hack/util: remove unused buildmode

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
v0.8
Akihiro Suda 2020-11-26 13:36:30 +09:00
parent de3e15b5dc
commit 24affe0a40
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A
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