#!/bin/sh

set +x
set +e


# we are running in dbld/images as current directory and we need dbld
cd ../..
DBLD_DIR="./${BUILD_PATH}"

ARG_IMAGE_PLATFORM=$(basename $DOCKERFILE_PATH .dockerfile)
${DBLD_DIR}/prepare-image-build $ARG_IMAGE_PLATFORM
docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) --build-arg=ARG_IMAGE_PLATFORM=${ARG_IMAGE_PLATFORM} -t $IMAGE_NAME -f ${DBLD_DIR}/$DOCKERFILE_PATH ${DBLD_DIR}
