diff --git a/build/lib/release.sh b/build/lib/release.sh index 0482b61f4d4..6bc6624951e 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -216,6 +216,8 @@ function kube::release::package_node_tarballs() { # Package up all of the server binaries in docker images function kube::release::build_server_images() { + kube::util::ensure-docker-buildx + # Clean out any old images rm -rf "${RELEASE_IMAGES}" local platform diff --git a/hack/lib/util.sh b/hack/lib/util.sh index 1e6e80ba7ec..748d5e588cc 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -707,14 +707,14 @@ function kube::util::ensure-cfssl { popd > /dev/null || return 1 } -# kube::util::ensure_dockerized -# Confirms that the script is being run inside a kube-build image +# kube::util::ensure-docker-buildx +# Check if we have "docker buildx" commands available # -function kube::util::ensure_dockerized { - if [[ -f /kube-build-image ]]; then +function kube::util::ensure-docker-buildx { + if docker buildx >/dev/null 2>&1; then return 0 else - echo "ERROR: This script is designed to be run inside a kube-build container" + echo "ERROR: docker buildx not available. Docker 19.03 or higher is required with experimental features enabled" exit 1 fi } diff --git a/test/images/image-util.sh b/test/images/image-util.sh index c89c52e645d..60ddd613f2e 100755 --- a/test/images/image-util.sh +++ b/test/images/image-util.sh @@ -111,6 +111,7 @@ build() { fi kube::util::ensure-gnu-sed + kube::util::ensure-docker-buildx for os_arch in ${os_archs}; do splitOsArch "${image}" "${os_arch}"