@@ -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
8282function push {
8383 docker push " $( image_ref spark) "
84+ docker push " $( image_ref spark-py) "
8485}
8586
8687function 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
103105Using minikube when building images will do so directly into minikube's Docker daemon.
104106There is no need to push the images into minikube in that case, they'll be automatically
@@ -127,14 +129,16 @@ REPO=
127129TAG=
128130BASEDOCKERFILE=
129131PYDOCKERFILE=
130- while getopts f:mr:t: option
132+ NOCACHEARG=
133+ while getopts f:mr:t:n option
131134do
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