Skip to content

Commit 662bd4a

Browse files
committed
Check required commands
1 parent 573ff6a commit 662bd4a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

custom-domain/dstack-ingress/build-image.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ while [[ $# -gt 0 ]]; do
2222
;;
2323
esac
2424
done
25+
26+
require_command() {
27+
local cmd="$1"
28+
if ! command -v "$cmd" >/dev/null 2>&1; then
29+
echo "Error: required command '$cmd' not found in PATH" >&2
30+
exit 1
31+
fi
32+
}
33+
34+
for required in docker skopeo jq git; do
35+
require_command "$required"
36+
done
37+
2538
# Check if buildkit_20 already exists before creating it
2639
if ! docker buildx inspect buildkit_20 &>/dev/null; then
2740
docker buildx create --use --driver-opt image=moby/buildkit:v0.20.2 --name buildkit_20

0 commit comments

Comments
 (0)