Skip to content

Commit 1149cf0

Browse files
committed
ci: provide feedback when running an image on the wrong host arch
1 parent 5c876f3 commit 1149cf0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/ci/docker/run.sh

+22
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
123123
-
124124
else
125125
echo Invalid image: $image
126+
127+
# Check whether the image exists for other architectures
128+
for arch_dir in "${script_dir}"/host-*; do
129+
# Avoid checking non-directories and the current host architecture directory
130+
if ! [[ -d "${arch_dir}" ]]; then
131+
continue
132+
fi
133+
if [[ "${arch_dir}" = "${docker_dir}" ]]; then
134+
continue
135+
fi
136+
137+
arch_name="$(basename "${arch_dir}" | sed 's/^host-//')"
138+
if [[ -f "${arch_dir}/${image}/Dockerfile" ]]; then
139+
echo "Note: the image exists for the ${arch_name} host architecture"
140+
elif [[ -f "${arch_dir}/disabled/${image}/Dockerfile" ]]; then
141+
echo "Note: the disabled image exists for the ${arch_name} host architecture"
142+
else
143+
continue
144+
fi
145+
echo "Note: the current host architecture is $(uname -m)"
146+
done
147+
126148
exit 1
127149
fi
128150

0 commit comments

Comments
 (0)