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

nicknezis 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 a51c822  Use Build Kit docker feature to shrink the Docker image size 
(#3669)
a51c822 is described below

commit a51c822951aaccc381c2f2fdc9973003a5be7a09
Author: Nicholas Nezis <[email protected]>
AuthorDate: Tue Jan 26 23:52:37 2021 -0500

    Use Build Kit docker feature to shrink the Docker image size (#3669)
---
 docker/compile/Dockerfile.centos7        |  3 +-
 docker/compile/Dockerfile.debian10       |  3 +-
 docker/compile/Dockerfile.debian9        | 51 ----------------------
 docker/compile/Dockerfile.ubuntu18.04    |  3 +-
 docker/compile/Dockerfile.ubuntu20.04    |  3 +-
 docker/dist/Dockerfile.dist.centos7      | 15 +++----
 docker/dist/Dockerfile.dist.debian10     | 22 ++++------
 docker/dist/Dockerfile.dist.debian9      | 65 ----------------------------
 docker/dist/Dockerfile.dist.ubuntu14.04  | 66 -----------------------------
 docker/dist/Dockerfile.dist.ubuntu16.04  | 72 --------------------------------
 docker/dist/Dockerfile.dist.ubuntu18.04  | 19 ++++-----
 docker/dist/Dockerfile.dist.ubuntu20.04  | 20 ++++-----
 docker/dist/scripts/install-zookeeper.sh |  8 ++--
 docker/scripts/build-base.sh             |  2 +-
 docker/scripts/build-docker.sh           |  4 +-
 docker/scripts/build-exec-docker.sh      |  2 +-
 docker/scripts/ci-docker.sh              |  4 +-
 docker/scripts/compile-docker.sh         |  4 +-
 docker/scripts/dev-env-create.sh         |  2 +-
 docker/scripts/test-docker.sh            |  2 +-
 20 files changed, 54 insertions(+), 316 deletions(-)

diff --git a/docker/compile/Dockerfile.centos7 
b/docker/compile/Dockerfile.centos7
index 14832e6..06c4402 100644
--- a/docker/compile/Dockerfile.centos7
+++ b/docker/compile/Dockerfile.centos7
@@ -51,7 +51,8 @@ ENV bazelVersion 3.7.2
 
 RUN wget -O /tmp/bazel.sh 
https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh
 \
       && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
+      && /tmp/bazel.sh \
+      && rm -rf /tmp/bazel.sh
 
 ADD bazelrc /root/.bazelrc
 ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/compile/Dockerfile.debian10 
b/docker/compile/Dockerfile.debian10
index f776a0b..ccb652e 100644
--- a/docker/compile/Dockerfile.debian10
+++ b/docker/compile/Dockerfile.debian10
@@ -47,7 +47,8 @@ ENV bazelVersion 3.7.2
 
 RUN wget -O /tmp/bazel.sh 
https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh
 \
       && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
+      && /tmp/bazel.sh \
+      && rm -rf /tmp/bazel.sh
 
 ADD bazelrc /root/.bazelrc
 ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/compile/Dockerfile.debian9 
b/docker/compile/Dockerfile.debian9
deleted file mode 100644
index 1e27a93..0000000
--- a/docker/compile/Dockerfile.debian9
+++ /dev/null
@@ -1,51 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-FROM openjdk:11-jdk-stretch
-
-# This is passed to the heron build command via the --config flag
-ENV TARGET_PLATFORM debian
-
-RUN apt-get update && apt-get -y install \
-      ant \
-      automake \
-      build-essential \
-      cmake \
-      curl \
-      git \
-      libcppunit-dev \
-      libssl-dev \
-      libtool \
-      libtool-bin \
-      pkg-config \
-      python \
-      python3-dev \
-      python3-setuptools \
-      software-properties-common \
-      tree \
-      unzip \
-      wget \
-      zip
-
-ENV bazelVersion 3.7.2
-
-RUN wget -O /tmp/bazel.sh 
https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh
 \
-      && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
-
-ADD bazelrc /root/.bazelrc
-ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/compile/Dockerfile.ubuntu18.04 
b/docker/compile/Dockerfile.ubuntu18.04
index 3743cb5..08860e9 100644
--- a/docker/compile/Dockerfile.ubuntu18.04
+++ b/docker/compile/Dockerfile.ubuntu18.04
@@ -48,7 +48,8 @@ ENV bazelVersion 3.7.2
 
 RUN wget -O /tmp/bazel.sh 
https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh
 \
       && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
+      && /tmp/bazel.sh \
+      && rm -rf /tmp/bazel.sh
 
 ADD bazelrc /root/.bazelrc
 ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/compile/Dockerfile.ubuntu20.04 
b/docker/compile/Dockerfile.ubuntu20.04
index 408d9b1..79f877a 100644
--- a/docker/compile/Dockerfile.ubuntu20.04
+++ b/docker/compile/Dockerfile.ubuntu20.04
@@ -49,7 +49,8 @@ ENV bazelVersion 3.7.2
 
 RUN wget -O /tmp/bazel.sh 
https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh
 \
       && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
+      && /tmp/bazel.sh \
+      && rm -rf /tmp/bazel.sh
 
 ADD bazelrc /root/.bazelrc
 ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/dist/Dockerfile.dist.centos7 
b/docker/dist/Dockerfile.dist.centos7
index cf243c5..70ee110 100644
--- a/docker/dist/Dockerfile.dist.centos7
+++ b/docker/dist/Dockerfile.dist.centos7
@@ -15,12 +15,12 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+#syntax=docker/dockerfile:1.2
 FROM centos:centos7
 
 ENV LC_ALL en_US.utf8
 
 RUN yum -y install epel-release \
-    && yum -y update \
     && yum -y install \
     curl \
     java-11-openjdk-headless \
@@ -34,14 +34,12 @@ RUN yum -y install epel-release \
 
 ENV JAVA_HOME /usr/
 
-ADD artifacts /heron
+# run Heron installer
+RUN --mount=type=bind,source=artifacts,target=/tmp/heron 
/tmp/heron/heron-install.sh \
+    && rm -f /usr/local/heron/dist/heron-core.tar.gz
 
 WORKDIR /heron
 
-# run heron installer
-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 \
@@ -55,11 +53,10 @@ RUN ln -s /usr/local/heron/dist/heron-core /heron \
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
 
-# install zookeeper
+# install Zookeeper
 ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
 
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
+RUN --mount=type=bind,source=dist,target=/opt/heron-docker/ sh 
/opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
 
 ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
 ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
diff --git a/docker/dist/Dockerfile.dist.debian10 
b/docker/dist/Dockerfile.dist.debian10
index 1aa1bec..73955e6 100644
--- a/docker/dist/Dockerfile.dist.debian10
+++ b/docker/dist/Dockerfile.dist.debian10
@@ -15,8 +15,12 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+#syntax=docker/dockerfile:1.2
 FROM openjdk:11-jdk-slim-buster
 
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
+
 RUN apt-get update \
     && apt-get -y install \
     curl \
@@ -27,17 +31,12 @@ RUN apt-get update \
     unzip \
     && apt-get clean
 
-ADD artifacts /heron
+# run Heron installer
+RUN --mount=type=bind,source=artifacts,target=/tmp/heron 
/tmp/heron/heron-install.sh \
+    && rm -f /usr/local/heron/dist/heron-core.tar.gz
 
 WORKDIR /heron
 
-# run heron installer
-RUN /heron/heron-install.sh && \
-    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 \
@@ -51,14 +50,11 @@ RUN ln -s /usr/local/heron/dist/heron-core /heron \
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
 
-# install zookeeper
+# install Zookeeper
 ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
 
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
+RUN --mount=type=bind,source=dist,target=/opt/heron-docker/ sh 
/opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
 
 ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
 ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
 
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
diff --git a/docker/dist/Dockerfile.dist.debian9 
b/docker/dist/Dockerfile.dist.debian9
deleted file mode 100644
index 33ac950..0000000
--- a/docker/dist/Dockerfile.dist.debian9
+++ /dev/null
@@ -1,65 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-FROM openjdk:11-jdk-slim-stretch
-
-RUN apt-get -y update \
-    && apt-get -y install \
-    curl \
-    netcat-openbsd \
-    python3 \
-    python3-dev \
-    supervisor \
-    unzip \
-    && apt-get clean all \
-    && rm -rf /var/lib/apt/lists/*
-
-ADD artifacts /heron
-
-WORKDIR /heron
-
-# run heron installer
-RUN /heron/heron-install.sh && \
-    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/
-RUN export HERON_HOME
-
-# install zookeeper
-ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
-
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
-
-ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
-ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
-
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
diff --git a/docker/dist/Dockerfile.dist.ubuntu14.04 
b/docker/dist/Dockerfile.dist.ubuntu14.04
deleted file mode 100644
index b8108f6..0000000
--- a/docker/dist/Dockerfile.dist.ubuntu14.04
+++ /dev/null
@@ -1,66 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-FROM ubuntu:14.04
-
-RUN apt-get -y update \
-    && apt-get -y install \
-    curl \
-    netcat-openbsd \
-    python3 \
-    python3-distutils \
-    software-properties-common \
-    supervisor \
-    unzip \
-    && apt-get clean
-
-RUN add-apt-repository ppa:openjdk-r/ppa \
-    && apt-get -y update \
-    && apt-get -y install openjdk-11-jdk-headless \
-    && apt-get clean
-
-ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
-RUN update-ca-certificates -f
-
-ADD artifacts /heron
-
-WORKDIR /heron
-
-# run heron installer
-RUN /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
-
-# install zookeeper
-ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
-
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
-
-ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
-ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
diff --git a/docker/dist/Dockerfile.dist.ubuntu16.04 
b/docker/dist/Dockerfile.dist.ubuntu16.04
deleted file mode 100644
index 7a4357d..0000000
--- a/docker/dist/Dockerfile.dist.ubuntu16.04
+++ /dev/null
@@ -1,72 +0,0 @@
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-
-FROM ubuntu:16.04
-
-RUN apt-get -y update \
-    && apt-get install -y \
-    curl \
-    netcat-openbsd \
-    python3 \
-    python3-distutils \
-    software-properties-common \
-    supervisor \
-    unzip \
-    && apt-get clean
-
-RUN add-apt-repository ppa:openjdk-r/ppa
-
-RUN apt-get update \
-    && apt-get -y install \
-    openjdk-11-jdk-headless \
-    && apt-get clean
-
-ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
-RUN update-ca-certificates -f
-
-ADD artifacts /heron
-
-WORKDIR /heron
-
-# run heron installer
-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
-
-# install zookeeper
-ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
-
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
-
-ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
-ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
-
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
diff --git a/docker/dist/Dockerfile.dist.ubuntu18.04 
b/docker/dist/Dockerfile.dist.ubuntu18.04
index 620df60..d4ab6d0 100644
--- a/docker/dist/Dockerfile.dist.ubuntu18.04
+++ b/docker/dist/Dockerfile.dist.ubuntu18.04
@@ -17,6 +17,9 @@
 
 FROM ubuntu:18.04
 
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
+
 RUN apt-get -y update \
     && apt-get -y install \
     curl \
@@ -31,14 +34,12 @@ RUN apt-get -y update \
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 RUN update-ca-certificates -f
 
-ADD artifacts /heron
+# run Heron installer
+RUN --mount=type=bind,source=artifacts,target=/tmp/heron 
/tmp/heron/heron-install.sh \
+    && rm -f /usr/local/heron/dist/heron-core.tar.gz
 
 WORKDIR /heron
 
-# run heron installers
-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 \
@@ -52,14 +53,10 @@ RUN ln -s /usr/local/heron/dist/heron-core /heron \
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
 
-# install zookeeper
+# install Zookeeper
 ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
 
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
+RUN --mount=type=bind,source=dist,target=/opt/heron-docker/ sh 
/opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
 
 ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
 ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
-
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
diff --git a/docker/dist/Dockerfile.dist.ubuntu20.04 
b/docker/dist/Dockerfile.dist.ubuntu20.04
index 36a3afd..e04ec01 100644
--- a/docker/dist/Dockerfile.dist.ubuntu20.04
+++ b/docker/dist/Dockerfile.dist.ubuntu20.04
@@ -15,10 +15,14 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+#syntax=docker/dockerfile:1.2
 FROM ubuntu:20.04
 
 ARG DEBIAN_FRONTEND=noninteractive
 
+ENV LC_ALL C.UTF-8
+ENV LANG C.UTF-8
+
 RUN apt-get -y update \
     && apt-get -y install \
     curl \
@@ -33,14 +37,12 @@ RUN apt-get -y update \
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 RUN update-ca-certificates -f
 
-ADD artifacts /heron
+# run Heron installer
+RUN --mount=type=bind,source=artifacts,target=/tmp/heron 
/tmp/heron/heron-install.sh \
+    && rm -f /usr/local/heron/dist/heron-core.tar.gz
 
 WORKDIR /heron
 
-# run heron installers
-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 \
@@ -54,14 +56,10 @@ RUN ln -s /usr/local/heron/dist/heron-core /heron \
 ENV HERON_HOME /heron/heron-core/
 RUN export HERON_HOME
 
-# install zookeeper
+# install Zookeeper
 ARG ZK_DIST=zookeeper-3.5.8
-ADD dist/scripts /opt/heron-docker/scripts
 
-RUN sh /opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
+RUN --mount=type=bind,source=dist,target=/opt/heron-docker/ sh 
/opt/heron-docker/scripts/install-zookeeper.sh $ZK_DIST
 
 ADD dist/conf/zookeeper.conf /opt/zookeeper/conf/zookeeper.conf
 ADD dist/conf/sandbox.conf /etc/supervisor/conf.d/
-
-ENV LC_ALL C.UTF-8
-ENV LANG C.UTF-8
diff --git a/docker/dist/scripts/install-zookeeper.sh 
b/docker/dist/scripts/install-zookeeper.sh
index ea86e91..a9e4cf7 100755
--- a/docker/dist/scripts/install-zookeeper.sh
+++ b/docker/dist/scripts/install-zookeeper.sh
@@ -40,10 +40,10 @@ rm -rf \
 # copy zk scripts
 mkdir -p /opt/zookeeper/scripts
 cp /opt/heron-docker/scripts/generate-zookeeper-config.sh 
/opt/zookeeper/scripts/
-chmod +x /opt/heron-docker/scripts/generate-zookeeper-config.sh
+chmod +x /opt/zookeeper/scripts/generate-zookeeper-config.sh
 cp /opt/heron-docker/scripts/zookeeper-ruok.sh /opt/zookeeper/scripts/
-chmod +x /opt/heron-docker/scripts/zookeeper-ruok.sh
+chmod +x /opt/zookeeper/scripts/zookeeper-ruok.sh
 cp /opt/heron-docker/scripts/start-zookeeper.sh /opt/zookeeper/scripts/
-chmod +x /opt/heron-docker/scripts/start-zookeeper.sh
+chmod +x /opt/zookeeper/scripts/start-zookeeper.sh
 cp /opt/heron-docker/scripts/wait-for-zookeeper.sh /opt/zookeeper/scripts/
-chmod +x /opt/heron-docker/scripts/wait-for-zookeeper.sh
+chmod +x /opt/zookeeper/scripts/wait-for-zookeeper.sh
diff --git a/docker/scripts/build-base.sh b/docker/scripts/build-base.sh
index 39de3ee..5758f99 100755
--- a/docker/scripts/build-base.sh
+++ b/docker/scripts/build-base.sh
@@ -72,7 +72,7 @@ run_build() {
   export HERON_VERSION
 
   echo "Building heron base docker image with tag:$DOCKER_TAG"
-  docker build --squash -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
+  docker buildx build -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
 
   echo "Saving docker image to $DOCKER_IMAGE_FILE"
   docker save -o $DOCKER_IMAGE_FILE $DOCKER_TAG
diff --git a/docker/scripts/build-docker.sh b/docker/scripts/build-docker.sh
index 46d4c87..09c074d 100755
--- a/docker/scripts/build-docker.sh
+++ b/docker/scripts/build-docker.sh
@@ -74,9 +74,9 @@ run_build() {
 
   echo "Building docker image with tag:$DOCKER_TAG"
   if [ $DOCKER_SQUASH = true ]; then
-    docker build --squash -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
+    docker buildx build --squash -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
   else
-    docker build -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f "$DOCKER_FILE" 
"$SCRATCH_DIR"
+    docker buildx build -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
   fi
   # save the image as a tar file
   
DOCKER_IMAGE_FILE="$OUTPUT_DIRECTORY/heron-docker-$HERON_VERSION-$TARGET_PLATFORM.tar"
diff --git a/docker/scripts/build-exec-docker.sh 
b/docker/scripts/build-exec-docker.sh
index 84d85ca..066f192 100755
--- a/docker/scripts/build-exec-docker.sh
+++ b/docker/scripts/build-exec-docker.sh
@@ -68,7 +68,7 @@ build_exec_image() {
 
   # build the image
   echo "Building docker image with tag:$DOCKER_TAG"
-  docker build --build-arg heronVersion=$HERON_VERSION -t "$DOCKER_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
+  docker buildx build --build-arg heronVersion=$HERON_VERSION -t "$DOCKER_TAG" 
-f "$DOCKER_FILE" "$SCRATCH_DIR"
 
   # save the image as a tar file
   
DOCKER_IMAGE_FILE="$OUTPUT_DIRECTORY/heron-docker-$HERON_VERSION-$TARGET_PLATFORM.tar"
diff --git a/docker/scripts/ci-docker.sh b/docker/scripts/ci-docker.sh
index 17e20f5..e573929 100755
--- a/docker/scripts/ci-docker.sh
+++ b/docker/scripts/ci-docker.sh
@@ -80,9 +80,9 @@ build_exec_image() {
   # build the image
   echo "Building docker image with tag:$DOCKER_TAG"
   if [ "$HERON_VERSION" == "nightly" ]; then
-    docker build -t "$DOCKER_TAG" -f "$DOCKER_FILE" "$SCRATCH_DIR"
+    docker buildx build -t "$DOCKER_TAG" -f "$DOCKER_FILE" "$SCRATCH_DIR"
   else
-    docker build -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f "$DOCKER_FILE" 
"$SCRATCH_DIR"
+    docker buildx build -t "$DOCKER_TAG" -t "$DOCKER_LATEST_TAG" -f 
"$DOCKER_FILE" "$SCRATCH_DIR"
   fi
 
   # save the image as a tar file
diff --git a/docker/scripts/compile-docker.sh b/docker/scripts/compile-docker.sh
index e724a2e..82e18a6 100755
--- a/docker/scripts/compile-docker.sh
+++ b/docker/scripts/compile-docker.sh
@@ -42,10 +42,10 @@ copy_bazel_rc_to() {
 
 DOCKER_FILE=$(dockerfile_path_for_platform $TARGET_PLATFORM)
 verify_dockerfile_exists $DOCKER_FILE
-copy_bazel_rc_to  $SCRATCH_DIR/bazelrc
+copy_bazel_rc_to $SCRATCH_DIR/bazelrc
 
 echo "Building heron-compiler container"
-docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE $SCRATCH_DIR
+docker buildx build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE 
$SCRATCH_DIR
 
 echo "Running build in container"
 docker run \
diff --git a/docker/scripts/dev-env-create.sh b/docker/scripts/dev-env-create.sh
index 7c0ce9c..e94be51 100755
--- a/docker/scripts/dev-env-create.sh
+++ b/docker/scripts/dev-env-create.sh
@@ -78,7 +78,7 @@ verify_dockerfile_exists $DOCKER_FILE
 copy_extra_files
 
 echo "Building docker image for Heron development environment on 
$TARGET_PLATFORM"
-docker build -t $REPOSITORY:$TARGET_PLATFORM -f $DOCKER_FILE $SCRATCH_DIR
+docker buildx build -t $REPOSITORY:$TARGET_PLATFORM -f $DOCKER_FILE 
$SCRATCH_DIR
 
 echo "Creating and starting container and mapping the current dir to /heron"
 docker container run -it \
diff --git a/docker/scripts/test-docker.sh b/docker/scripts/test-docker.sh
index ca1b4db..f816e2f 100755
--- a/docker/scripts/test-docker.sh
+++ b/docker/scripts/test-docker.sh
@@ -45,7 +45,7 @@ verify_dockerfile_exists $DOCKER_FILE
 copy_bazel_rc_to  $SCRATCH_DIR/bazelrc
 
 echo "Building heron-compiler container"
-docker build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE $SCRATCH_DIR
+docker buildx build -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE 
$SCRATCH_DIR
 
 echo "Running build in container"
 docker run \

Reply via email to