Skip to content

Commit

Permalink
Check to see if docker compose exists, else error out (getsentry#1733)
Browse files Browse the repository at this point in the history
* check to see if docker compose exists

* add check for docker version command doesn't error out

* clean up exception handling of docker commands

* merge master
  • Loading branch information
hubertdeng123 authored Oct 4, 2022
1 parent 202742c commit 1920b23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions install/check-minimum-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function vergte () { printf "%s\n%s" $1 $2 | sort --version-sort --check=quiet -



DOCKER_VERSION=$(docker version --format '{{.Server.Version}}')
DOCKER_VERSION=$(docker version --format '{{.Server.Version}}' || echo '')
if [[ -z "$DOCKER_VERSION" ]]; then
echo "FAIL: Unable to get docker version, is the docker daemon running?"
exit 1
Expand All @@ -19,7 +19,12 @@ if [[ "$(vergte ${DOCKER_VERSION//v} $MIN_DOCKER_VERSION)" -eq 1 ]]; then
fi
echo "Found Docker version $DOCKER_VERSION"

COMPOSE_VERSION=$($dc_base version --short)
COMPOSE_VERSION=$($dc_base version --short || echo '')
if [[ -z "$COMPOSE_VERSION" ]]; then
echo "FAIL: Docker compose is required to run self-hosted"
exit 1
fi

if [[ "$(vergte ${COMPOSE_VERSION//v} $MIN_COMPOSE_VERSION)" -eq 1 ]]; then
echo "FAIL: Expected minimum $dc_base version to be $MIN_COMPOSE_VERSION but found $COMPOSE_VERSION"
exit 1
Expand Down

0 comments on commit 1920b23

Please sign in to comment.