#!/bin/bash

set -eo pipefail

source "ci/_build_ci_image_common"

build() {
    echo "Building Go FIPS image: ${BUILD_IMAGE}"
    docker build \
           --cache-from "${BUILD_IMAGE}" \
           --build-arg GO_VERSION="${GO_VERSION}" \
           --build-arg UBI_VERSION="${UBI_VERSION}" \
           -t "${BUILD_IMAGE}" \
           -f "${BUILD_DOCKERFILE}" \
           "${GIT_ROOT}"
}

login
pull
build
push
logout
scan
