Skip to content

Commit

Permalink
dockerfile: mitigate flaky smoke test with timeout
Browse files Browse the repository at this point in the history
"buildkitd --version" might hang when using emulation during
smoke test. Add a timeout to mitigate this issue and avoid blocking
CI. This is currently tracked in moby#4491

Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Dec 19, 2023
1 parent 1b54129 commit 6d90500
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ RUN --mount=target=. --mount=target=/root/.cache,type=cache \
set -ex
xx-go build ${GOBUILDFLAGS} -gcflags="${GOGCFLAGS}" -ldflags "$(cat /tmp/.ldflags) -extldflags '-static'" -tags "osusergo netgo static_build seccomp ${BUILDKITD_TAGS}" -o /usr/bin/buildkitd ./cmd/buildkitd
xx-verify ${VERIFYFLAGS} /usr/bin/buildkitd
if [ "$(xx-info os)" = "linux" ]; then /usr/bin/buildkitd --version; fi
if [ "$(xx-info os)" = "linux" ]; then
set +e
timeout 3 /usr/bin/buildkitd --version
exitcode=$?
if [ $exitcode -eq 124 ]; then
echo "WARN: buildkitd --version timed out"
elif [ $exitcode -ne 0 ]; then
exit $exitcode
fi
fi
EOT

FROM scratch AS binaries-linux
Expand Down

0 comments on commit 6d90500

Please sign in to comment.