Skip to content

Commit

Permalink
[SPARK-32866][K8S] Fix docker cross-build
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Add `--push` to the docker script for buildx

### Why are the changes needed?

Doing a separate docker push with `buildx` images doesn't work.

### Does this PR introduce _any_ user-facing change?

Automatically pushes work when cross-building.

### How was this patch tested?

cross-built docker containers

Closes apache#31299 from holdenk/SPARK-32866-docker-buildx-update.

Authored-by: Holden Karau <[email protected]>
Signed-off-by: Holden Karau <[email protected]>
(cherry picked from commit 497f599)
Signed-off-by: Holden Karau <[email protected]>
  • Loading branch information
holdenk committed Jan 28, 2021
1 parent 451baad commit 697bdca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/docker-image-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function build {
error "Failed to build Spark JVM Docker image, please refer to Docker build output for details."
fi
if [ "${CROSS_BUILD}" != "false" ]; then
(cd $(img_ctx_dir base) && docker buildx build $ARCHS $NOCACHEARG "${BUILD_ARGS[@]}" \
(cd $(img_ctx_dir base) && docker buildx build $ARCHS $NOCACHEARG "${BUILD_ARGS[@]}" --push \
-t $(image_ref spark) \
-f "$BASEDOCKERFILE" .)
fi
Expand All @@ -194,7 +194,7 @@ function build {
error "Failed to build PySpark Docker image, please refer to Docker build output for details."
fi
if [ "${CROSS_BUILD}" != "false" ]; then
(cd $(img_ctx_dir pyspark) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" \
(cd $(img_ctx_dir pyspark) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" --push \
-t $(image_ref spark-py) \
-f "$PYDOCKERFILE" .)
fi
Expand All @@ -208,7 +208,7 @@ function build {
error "Failed to build SparkR Docker image, please refer to Docker build output for details."
fi
if [ "${CROSS_BUILD}" != "false" ]; then
(cd $(img_ctx_dir sparkr) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" \
(cd $(img_ctx_dir sparkr) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" --push \
-t $(image_ref spark-r) \
-f "$RDOCKERFILE" .)
fi
Expand Down

0 comments on commit 697bdca

Please sign in to comment.