Skip to content

Commit

Permalink
fix: add DOCKER_DEFAULT_PLATFORM env var and verify required tools
Browse files Browse the repository at this point in the history
  • Loading branch information
pablon committed Nov 19, 2024
1 parent 409be26 commit b036a82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions start-game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit b036a82

Please sign in to comment.