Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bin/docker-image-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function build {
# Set image build arguments accordingly if this is a source repo and not a distribution archive.
IMG_PATH=resource-managers/kubernetes/docker/src/main/dockerfiles
BUILD_ARGS=(
${BUILD_PARAMS}
--build-arg
img_path=$IMG_PATH
--build-arg
Expand All @@ -57,13 +58,14 @@ function build {
else
# Not passed as an argument to docker, but used to validate the Spark directory.
IMG_PATH="kubernetes/dockerfiles"
BUILD_ARGS=()
BUILD_ARGS=(${BUILD_PARAMS})
fi

if [ ! -d "$IMG_PATH" ]; then
error "Cannot find docker image. This script must be run from a runnable distribution of Apache Spark."
fi
local BINDING_BUILD_ARGS=(
${BUILD_PARAMS}
--build-arg
base_img=$(image_ref spark)
)
Expand Down Expand Up @@ -101,6 +103,8 @@ Options:
-t tag Tag to apply to the built image, or to identify the image to be pushed.
-m Use minikube's Docker daemon.
-n Build docker image with --no-cache
-b arg Build arg to build or push the image. For multiple build args, this option needs to
be used separately for each build arg.

Using minikube when building images will do so directly into minikube's Docker daemon.
There is no need to push the images into minikube in that case, they'll be automatically
Expand Down Expand Up @@ -130,7 +134,8 @@ TAG=
BASEDOCKERFILE=
PYDOCKERFILE=
NOCACHEARG=
while getopts f:mr:t:n option
BUILD_PARAMS=
while getopts f:mr:t:n:b: option
do
case "${option}"
in
Expand All @@ -139,6 +144,7 @@ do
r) REPO=${OPTARG};;
t) TAG=${OPTARG};;
n) NOCACHEARG="--no-cache";;
b) BUILD_PARAMS=${BUILD_PARAMS}" --build-arg "${OPTARG};;
m)
if ! which minikube 1>/dev/null; then
error "Cannot find minikube."
Expand Down