You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by nw...@apache.org on 2019/01/17 22:52:43 UTC

[incubator-heron] branch master updated: Yaoli/fix dockerfiles (#3160)

This is an automated email from the ASF dual-hosted git repository.

nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e2afd0  Yaoli/fix dockerfiles (#3160)
9e2afd0 is described below

commit 9e2afd0fa0a36c46c73d8265502df7ce3716f680
Author: Yao Li <cl...@gmail.com>
AuthorDate: Thu Jan 17 14:52:38 2019 -0800

    Yaoli/fix dockerfiles (#3160)
    
    * only_using_heron-install.sh_for_building_docker_image
    
    Heron-install.sh contains everything needed for building Heron docker images. There is no need to copy heron-core.tar.gz into images, which will increase the image size.
---
 docker/dist/Dockerfile.dist.centos7     | 19 ++++++++++++-------
 docker/dist/Dockerfile.dist.debian9     | 13 ++++++++++---
 docker/dist/Dockerfile.dist.ubuntu14.04 | 10 +++++++++-
 docker/dist/Dockerfile.dist.ubuntu16.04 | 18 ++++++++++++------
 docker/dist/Dockerfile.dist.ubuntu18.04 | 18 ++++++++++++------
 docker/scripts/build-docker.sh          |  5 -----
 6 files changed, 55 insertions(+), 28 deletions(-)

diff --git a/docker/dist/Dockerfile.dist.centos7 b/docker/dist/Dockerfile.dist.centos7
index 0625068..950c40a 100644
--- a/docker/dist/Dockerfile.dist.centos7
+++ b/docker/dist/Dockerfile.dist.centos7
@@ -35,13 +35,18 @@ ADD artifacts /heron
 WORKDIR /heron
 
 # run heron installer
-RUN /heron/heron-install.sh
-
-RUN mkdir -p /opt/heron && \
-    tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron
-
-RUN rm -f /heron/heron-install.sh
-RUN rm -f /heron/heron-core.tar.gz
+RUN /heron/heron-install.sh \
+    && rm -f /heron/heron-install.sh
+
+RUN ln -s /usr/local/heron/dist/heron-core /heron \
+    && mkdir -p /heron/heron-tools \
+    && ln -s /usr/local/heron/bin /heron/heron-tools \
+    && ln -s /usr/local/heron/conf /heron/heron-tools \
+    && ln -s /usr/local/heron/dist /heron/heron-tools \
+    && ln -s /usr/local/heron/lib /heron/heron-tools \
+    && ln -s /usr/local/heron/release.yaml /heron/heron-tools \
+    && ln -s /usr/local/heron/examples /heron \
+    && ln -s /usr/local/heron/release.yaml /heron
 
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
diff --git a/docker/dist/Dockerfile.dist.debian9 b/docker/dist/Dockerfile.dist.debian9
index d7394e3..91441b9 100644
--- a/docker/dist/Dockerfile.dist.debian9
+++ b/docker/dist/Dockerfile.dist.debian9
@@ -31,16 +31,23 @@ ADD artifacts /heron
 
 WORKDIR /heron
 
-
 # run heron installer
 RUN /heron/heron-install.sh && \
-    tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron && \
-    rm -rf /heron/heron-core.tar.gz && \
     rm -rf /heron/heron-install.sh && \
     rm -rf /opt/heron/heron-core/lib/scheduler/heron-local-scheduler.jar && \
     rm -rf /opt/heron/heron-core/lib/scheduler/heron-mesos-scheduler.jar && \
     rm -rf /opt/heron/heron-core/lib/scheduler/heron-slurm-scheduler.jar
 
+RUN ln -s /usr/local/heron/dist/heron-core /heron \
+    && mkdir -p /heron/heron-tools \
+    && ln -s /usr/local/heron/bin /heron/heron-tools \
+    && ln -s /usr/local/heron/conf /heron/heron-tools \
+    && ln -s /usr/local/heron/dist /heron/heron-tools \
+    && ln -s /usr/local/heron/lib /heron/heron-tools \
+    && ln -s /usr/local/heron/release.yaml /heron/heron-tools \
+    && ln -s /usr/local/heron/examples /heron \
+    && ln -s /usr/local/heron/release.yaml /heron
+
 ENV HERON_HOME /heron/heron-core/
 
 # install zookeeper
diff --git a/docker/dist/Dockerfile.dist.ubuntu14.04 b/docker/dist/Dockerfile.dist.ubuntu14.04
index e448fe7..bb9f99b 100644
--- a/docker/dist/Dockerfile.dist.ubuntu14.04
+++ b/docker/dist/Dockerfile.dist.ubuntu14.04
@@ -37,7 +37,15 @@ WORKDIR /heron
 # run heron installer
 RUN /heron/heron-install.sh
 
-RUN tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron
+RUN ln -s /usr/local/heron/dist/heron-core /heron \
+    && mkdir -p /heron/heron-tools \
+    && ln -s /usr/local/heron/bin /heron/heron-tools \
+    && ln -s /usr/local/heron/conf /heron/heron-tools \
+    && ln -s /usr/local/heron/dist /heron/heron-tools \
+    && ln -s /usr/local/heron/lib /heron/heron-tools \
+    && ln -s /usr/local/heron/release.yaml /heron/heron-tools \
+    && ln -s /usr/local/heron/examples /heron \
+    && ln -s /usr/local/heron/release.yaml /heron
 
 ENV HERON_HOME /heron/heron-core/
 
diff --git a/docker/dist/Dockerfile.dist.ubuntu16.04 b/docker/dist/Dockerfile.dist.ubuntu16.04
index 3ec11da..cf4be9c 100644
--- a/docker/dist/Dockerfile.dist.ubuntu16.04
+++ b/docker/dist/Dockerfile.dist.ubuntu16.04
@@ -35,12 +35,18 @@ ADD artifacts /heron
 WORKDIR /heron
 
 # run heron installer
-RUN /heron/heron-install.sh
-
-RUN tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron
-
-RUN rm -f /heron/heron-install.sh
-RUN rm -f /heron/heron-core.tar.gz
+RUN /heron/heron-install.sh \
+    && rm -f /heron/heron-install.sh
+
+RUN ln -s /usr/local/heron/dist/heron-core /heron \
+    && mkdir -p /heron/heron-tools \
+    && ln -s /usr/local/heron/bin /heron/heron-tools \
+    && ln -s /usr/local/heron/conf /heron/heron-tools \
+    && ln -s /usr/local/heron/dist /heron/heron-tools \
+    && ln -s /usr/local/heron/lib /heron/heron-tools \
+    && ln -s /usr/local/heron/release.yaml /heron/heron-tools \
+    && ln -s /usr/local/heron/examples /heron \
+    && ln -s /usr/local/heron/release.yaml /heron \
 
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
diff --git a/docker/dist/Dockerfile.dist.ubuntu18.04 b/docker/dist/Dockerfile.dist.ubuntu18.04
index 5f7f921..66960e5 100644
--- a/docker/dist/Dockerfile.dist.ubuntu18.04
+++ b/docker/dist/Dockerfile.dist.ubuntu18.04
@@ -12,12 +12,18 @@ ADD artifacts /heron
 WORKDIR /heron
 
 # run heron installers
-RUN /heron/heron-install.sh
-
-RUN tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron
-
-RUN rm -f /heron/heron-install.sh
-RUN rm -f /heron/heron-core.tar.gz
+RUN /heron/heron-install.sh \
+    && rm -f /heron/heron-install.sh
+
+RUN ln -s /usr/local/heron/dist/heron-core /heron \
+    && mkdir -p /heron/heron-tools \
+    && ln -s /usr/local/heron/bin /heron/heron-tools \
+    && ln -s /usr/local/heron/conf /heron/heron-tools \
+    && ln -s /usr/local/heron/dist /heron/heron-tools \
+    && ln -s /usr/local/heron/lib /heron/heron-tools \
+    && ln -s /usr/local/heron/release.yaml /heron/heron-tools \
+    && ln -s /usr/local/heron/examples /heron \
+    && ln -s /usr/local/heron/release.yaml /heron
 
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
diff --git a/docker/scripts/build-docker.sh b/docker/scripts/build-docker.sh
index 8359aa3..17bcfa2 100755
--- a/docker/scripts/build-docker.sh
+++ b/docker/scripts/build-docker.sh
@@ -54,14 +54,9 @@ run_build() {
 
   setup_scratch_dir $SCRATCH_DIR
 
-  # need to copy artifacts locally
-  CORE_FILE="$OUTPUT_DIRECTORY/heron-core-$HERON_VERSION-$TARGET_PLATFORM.tar.gz"
-  CORE_OUT_FILE="$SCRATCH_DIR/artifacts/heron-core.tar.gz"
-
   ALL_FILE="$OUTPUT_DIRECTORY/heron-install-$HERON_VERSION-$TARGET_PLATFORM.sh"
   ALL_OUT_FILE="$SCRATCH_DIR/artifacts/heron-install.sh"
 
-  cp $CORE_FILE $CORE_OUT_FILE
   cp $ALL_FILE $ALL_OUT_FILE
   export HERON_VERSION