You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/07 03:18:43 UTC
[GitHub] [incubator-kyuubi] cfmcgrady commented on a change in pull request #1495: [KYUUBI #1480] Fix bug in docker-image-tool & Provider image way to config SPARK instead of local copy
cfmcgrady commented on a change in pull request #1495:
URL: https://github.com/apache/incubator-kyuubi/pull/1495#discussion_r763597633
##########
File path: docker/Dockerfile
##########
@@ -42,12 +44,12 @@ RUN set -ex && \
apt-get update && \
apt install -y bash tini libc6 libpam-modules krb5-user libnss3 procps && \
useradd -u ${kyuubi_uid} -g root kyuubi && \
- mkdir -p ${KYUUBI_HOME} ${KYUUBI_LOG_DIR} ${KYUUBI_PID_DIR} ${KYUUBI_WORK_DIR_ROOT} ${SPARK_HOME} && \
+ mkdir -p ${KYUUBI_HOME} ${KYUUBI_LOG_DIR} ${KYUUBI_PID_DIR} ${KYUUBI_WORK_DIR_ROOT} ${SPARK_BINARY} && \
chmod ug+rw -R ${KYUUBI_HOME} && \
chmod a+rwx -R ${KYUUBI_WORK_DIR_ROOT} && \
rm -rf /var/cache/apt/*
-COPY spark-binary ${SPARK_HOME}
+COPY spark-binary ${SPARK_BINARY}
Review comment:
How about
```Dockerfile
ARG BASE_IMAGE=openjdk:8-jre-slim
ARG BUILD_ENV=copy
FROM ${BASE_IMAGE} as build_copy
ONBUILD RUN echo "copy user specify spark binary...."
ONBUILD COPY user_specify_spark_path /path_to_spark
ONBUILD ENV SPARK_HOME /path_to_spark
FROM ${BASE_IMAGE} as build_no_copy
ONBUILD RUN echo "I don't copy"
ONBUILD ARG BUILDIN_SPARK_HOME="/opt/spark"
ONBUILD ENV SPARK_HOME ${BUILDIN_SPARK_HOME}
FROM build_${BUILD_ENV}
```
- build w/ copy user specify spark binary package
```shell
docker build --build-arg BUILD_ENV=copy -t ${your_image_tag} -f docker/Dockerfile .
```
- build w/o copy spark binary package
```shell
docker build --build-arg BUILD_ENV=no_copy --build-arg BUILDIN_SPARK_HOME="/path/to/spark_home" -t ${your_image_tag} -f docker/Dockerfile .
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org