Skip to content

Commit de34796

Browse files
committed
Add a sensible error message if buildx not installed
Many of our .buildbot_dockerfile_* files use `docker buildx` as part of the build process. If the host machine does not have this installed then tryci jobs fail much later on with very strange error messages. We should catch this early and make it clear what's going on.
1 parent 6311f71 commit de34796

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tryci

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ CAP_ARGS="--cap-add CAP_PERFMON --cap-add SYS_PTRACE --security-opt seccomp=unco
2020

2121
set -e
2222

23+
error() { printf "\e[31m[ERROR]\e[0m %s\n" "$1" >&2; }
24+
2325
run_image() {
2426
# Extract the dockerfile suffix. E.g. for '.buildbot_dockerfile_myrepo'
2527
# it's 'myimage'.
@@ -110,6 +112,12 @@ while [ $# -gt 0 ]; do
110112
esac
111113
done
112114

115+
if [ ! docker buildx version &>/dev/null ] && [ -z ${server} ]; then
116+
error "Docker Buildx is not installed or not available in your PATH".
117+
error "For installation instructions, visit: https://docs.docker.com/buildx/working-with-buildx/"
118+
exit 1
119+
fi
120+
113121
if [ ! -z ${server} ]; then
114122
export DOCKER_HOST="ssh://${server}"
115123
fi

0 commit comments

Comments
 (0)