Fix conditional to read better using a case statement

This commit is contained in:
Ani Balasubramaniam 2020-06-02 08:58:25 -07:00
parent c1d1015c9b
commit 4f5dfc4d1e

View File

@ -74,8 +74,14 @@ fi
BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')" BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
# Check the arch of the machine we're running on. If it's 64-bit, use a 32-bit base image instead # Check the arch of the machine we're running on. If it's 64-bit, use a 32-bit base image instead
ARCH=$(uname -m) case "$(uname -m)" in
[[ $ARCH == "x86_64" || $ARCH == "aarch64" ]] && BASE_IMAGE=i386/debian:buster || BASE_IMAGE=debian:buster x86_64|aarch64)
BASE_IMAGE=i386/debian:buster
;;
*)
BASE_IMAGE=debian:buster
;;
esac
${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}" ${DOCKER} build --build-arg BASE_IMAGE=${BASE_IMAGE} -t pi-gen "${DIR}"
if [ "${CONTAINER_EXISTS}" != "" ]; then if [ "${CONTAINER_EXISTS}" != "" ]; then