From 35549524ad400a1f3e2ed8f7b42e1b4aaa89a842 Mon Sep 17 00:00:00 2001 From: Pablo Nazar <73798198+pablon@users.noreply.github.com> Date: Tue, 19 Nov 2024 12:19:55 +0100 Subject: [PATCH] fix: add DOCKER_DEFAULT_PLATFORM env var and verify required tools --- start-game.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/start-game.sh b/start-game.sh index 01b807b..20995f9 100755 --- a/start-game.sh +++ b/start-game.sh @@ -86,6 +86,11 @@ function _error() { exit 1 } +# check required tools +(docker compose version &>/dev/null) || _error "Install docker compose first.${CLEAR}\n\thttps://docs.docker.com/compose/install/" +(type shuf &>/dev/null) || _error "Install 'coreutils' package first (required: shuf)." +(type awk &>/dev/null) || _error "Install 'awk' package first." + function divider() { [[ "${COLUMNS}" ]] || COLUMNS=80 eval printf '=%.0s' {1..$COLUMNS} @@ -225,6 +230,7 @@ EOF } function pull_image() { + export DOCKER_DEFAULT_PLATFORM=linux/amd64 # pull the bot image from public registry if [[ "${DEBUG}" ]]; then docker pull "${1}" || _error "Cannot pull image ${YELLOW}${1}"