Skip to content

Commit c17179b

Browse files
author
Ray Burgemeestre
committed
[SPARK-24547] Allow for building spark on k8s docker images without
cache, and include spark-py when pushing to registry.
1 parent 4c388bc commit c17179b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

bin/docker-image-tool.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,18 @@ function build {
7070
local BASEDOCKERFILE=${BASEDOCKERFILE:-"$IMG_PATH/spark/Dockerfile"}
7171
local PYDOCKERFILE=${PYDOCKERFILE:-"$IMG_PATH/spark/bindings/python/Dockerfile"}
7272

73-
docker build "${BUILD_ARGS[@]}" \
73+
docker build $NOCACHEARG "${BUILD_ARGS[@]}" \
7474
-t $(image_ref spark) \
7575
-f "$BASEDOCKERFILE" .
7676

77-
docker build "${BINDING_BUILD_ARGS[@]}" \
77+
docker build $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" \
7878
-t $(image_ref spark-py) \
7979
-f "$PYDOCKERFILE" .
8080
}
8181

8282
function push {
8383
docker push "$(image_ref spark)"
84+
docker push "$(image_ref spark-py)"
8485
}
8586

8687
function usage {
@@ -99,6 +100,7 @@ Options:
99100
-r repo Repository address.
100101
-t tag Tag to apply to the built image, or to identify the image to be pushed.
101102
-m Use minikube's Docker daemon.
103+
-n Build docker image with --no-cache
102104
103105
Using minikube when building images will do so directly into minikube's Docker daemon.
104106
There is no need to push the images into minikube in that case, they'll be automatically
@@ -127,14 +129,16 @@ REPO=
127129
TAG=
128130
BASEDOCKERFILE=
129131
PYDOCKERFILE=
130-
while getopts f:mr:t: option
132+
NOCACHEARG=
133+
while getopts f:mr:t:n option
131134
do
132135
case "${option}"
133136
in
134137
f) BASEDOCKERFILE=${OPTARG};;
135138
p) PYDOCKERFILE=${OPTARG};;
136139
r) REPO=${OPTARG};;
137140
t) TAG=${OPTARG};;
141+
n) NOCACHEARG="--no-cache";;
138142
m)
139143
if ! which minikube 1>/dev/null; then
140144
error "Cannot find minikube."

0 commit comments

Comments
 (0)