Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Use Build Kit docker feature to shrink the Docker image size #3669

Merged
merged 8 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker/compile/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion docker/compile/Dockerfile.debian10
Original file line number Diff line number Diff line change
Expand Up @@ -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
51 changes: 0 additions & 51 deletions docker/compile/Dockerfile.debian9

This file was deleted.

3 changes: 2 additions & 1 deletion docker/compile/Dockerfile.ubuntu18.04
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion docker/compile/Dockerfile.ubuntu20.04
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 6 additions & 9 deletions docker/dist/Dockerfile.dist.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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/
22 changes: 9 additions & 13 deletions docker/dist/Dockerfile.dist.debian10
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
65 changes: 0 additions & 65 deletions docker/dist/Dockerfile.dist.debian9

This file was deleted.

66 changes: 0 additions & 66 deletions docker/dist/Dockerfile.dist.ubuntu14.04

This file was deleted.

72 changes: 0 additions & 72 deletions docker/dist/Dockerfile.dist.ubuntu16.04

This file was deleted.

Loading