chore(build): Updating build script to take custom docker runtimes
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
9e7f1971dd
commit
ea54ab181b
1 changed files with 71 additions and 60 deletions
|
|
@ -14,6 +14,17 @@ image_tag=${IMAGE_TAG:-$git_sha}
|
|||
ee="false"
|
||||
# Possible values: amd64, arm64
|
||||
arch="${ARCH:-"amd64"}"
|
||||
docker() {
|
||||
local docker_cmd=${DOCKER_RUNTIME}
|
||||
[[ $docker_cmd == "docker" ]] && docker_cmd=$(which docker)
|
||||
if [[ "$1" == "build" ]]; then
|
||||
shift
|
||||
# Reconstruct command with DOCKER_ARGS before the '.'
|
||||
$docker_cmd build "${DOCKER_BUILD_ARGS}" "$@"
|
||||
else
|
||||
$docker_cmd "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
check_prereq() {
|
||||
which docker || {
|
||||
|
|
@ -46,7 +57,7 @@ update_helm_release() {
|
|||
function build_service() {
|
||||
image="$1"
|
||||
echo "BUILDING $image"
|
||||
docker build -t ${DOCKER_REPO:-'local'}/$image:${image_tag} --platform linux/$arch --build-arg ARCH=$arch --build-arg SERVICE_NAME=$image --build-arg GIT_SHA=$git_sha --build-arg GSSAPI=${GSSAPI:-'false'} .
|
||||
docker build -t ${DOCKER_REPO:-'local'}/$image:${image_tag} --platform linux/$arch --build-arg ARCH=$arch --build-arg SERVICE_NAME=$image --build-arg GIT_SHA=$git_sha .
|
||||
[[ $PUSH_IMAGE -eq 1 ]] && {
|
||||
docker push ${DOCKER_REPO:-'local'}/$image:${image_tag}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue