diff --git a/build/common.sh b/build/common.sh index 67b0a4927d8..f6def8f3e3b 100755 --- a/build/common.sh +++ b/build/common.sh @@ -384,7 +384,13 @@ function kube::build::short_hash() { # a workaround for bug https://github.com/docker/docker/issues/3968. function kube::build::destroy_container() { "${DOCKER[@]}" kill "$1" >/dev/null 2>&1 || true - "${DOCKER[@]}" wait "$1" >/dev/null 2>&1 || true + if [[ $("${DOCKER[@]}" version --format '{{.Server.Version}}') = 17.06.0* ]]; then + # Workaround https://github.com/moby/moby/issues/33948. + # TODO: remove when 17.06.0 is not relevant anymore + DOCKER_API_VERSION=v1.29 "${DOCKER[@]}" wait "$1" >/dev/null 2>&1 || true + else + "${DOCKER[@]}" wait "$1" >/dev/null 2>&1 || true + fi "${DOCKER[@]}" rm -f -v "$1" >/dev/null 2>&1 || true }