From b036a8276cc0c3ab414264e73aae96b13e565da5 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 328a259..a0dd9aa 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}"