Warn if docker buildx is not available

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2021-08-10 10:39:24 -04:00
parent bb793e8d4b
commit f63dbd481f
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
3 changed files with 8 additions and 5 deletions

View File

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

View File

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

View File

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