Skip to content

Commit

Permalink
Fail if docker command is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
miguno committed May 6, 2024
1 parent 72a4ccb commit 5b92673
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions create_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ set -uo pipefail
# Import environment variables from .env
set -o allexport && source .env && set +o allexport

# Check requirements
if ! command -v docker &> /dev/null; then
echo "ERROR: 'docker' command not available. Is Docker installed?"
exit 1
fi

echo "Building image '$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG'..."
# TIP: Add `--progress=plain` to see the full docker output when you are
# troubleshooting the build setup of your image.
Expand Down
6 changes: 6 additions & 0 deletions start_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ set -uo pipefail
# Import environment variables from .env
set -o allexport && source .env && set +o allexport

# Check requirements
if ! command -v docker &> /dev/null; then
echo "ERROR: 'docker' command not available. Is Docker installed?"
exit 1
fi

# Force amd64 as the platform. This workaround is needed on Apple Silicon
# machines. Details at https://stackoverflow.com/questions/72152446/.
declare -r DOCKER_OPTIONS="--platform linux/amd64"
Expand Down

0 comments on commit 5b92673

Please sign in to comment.