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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 27a38840603 [refactor](docker)Dockerfile shell refactor (#27569)
27a38840603 is described below

commit 27a3884060319fef58b6480a512064a2f471023c
Author: FreeOnePlus <[email protected]>
AuthorDate: Sat Dec 16 23:45:06 2023 +0800

    [refactor](docker)Dockerfile shell refactor (#27569)
---
 docker/runtime/be/Dockerfile | 53 ++++++++++++++++++++++++++++----------------
 docker/runtime/fe/Dockerfile | 50 ++++++++++++++++++++++++++---------------
 2 files changed, 66 insertions(+), 37 deletions(-)

diff --git a/docker/runtime/be/Dockerfile b/docker/runtime/be/Dockerfile
index 95eda2ca1c0..0833b44d1ff 100644
--- a/docker/runtime/be/Dockerfile
+++ b/docker/runtime/be/Dockerfile
@@ -16,27 +16,42 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# how to use Dockerfile.
+# this is dockerfile for build doris fe image on amd64.
+# when build youself image.
+# 1. pull binary from official website and decompress into resource directory 
that the level equals with Dockerfile_be_ubuntu.
+# 2. untar xxxx.tar.gz in resource directory, update the dockerfile field 
`apache-doris-xxx`, replace with real version.
+# 3. run commad docker build -t xxx.doris.be:xx -f Dockerfile_be_ubuntu.
+
+# we have support buildx for amd64 and arm64 architecture image build.
+# get the binary from doris github and utar into resource, update the 
directory as apache-`version(example:2.0.1)`-bin-`architecture(amd64/arm64)` 
mode.
+
 # choose a base image
-FROM openjdk:8u342-jdk
+FROM ubuntu:22.04
+
+ARG TARGETARCH
+
+RUN apt-get update -y &&  DEBIAN_FRONTEND=noninteractive apt-get install -y 
--no-install-recommends \
+    patchelf gdb binutils binutils-common mysql-client \
+    curl wget less vim htop iproute2 numactl jq iotop sysstat \
+    tcpdump iputils-ping dnsutils strace lsof blktrace tzdata \
+    bpfcc-tools linux-headers-realtime linux-tools-realtime silversearcher-ag \
+    net-tools openjdk-8-jdk && \
+    rm -rf /var/lib/apt/lists/*
 
 # set environment variables
-ENV JAVA_HOME="/usr/local/openjdk-8/" \
-       PATH="/opt/apache-doris/be/bin:${PATH}"
-
-# download the software to the mirror and replace it as needed
-ADD ./resource/apache-doris-be-x.x.x-bin-x86_64.tar.gz /opt/
-
-# deploy software
-RUN apt-get update && \
-       apt-get install -y default-mysql-client && \
-       apt-get clean && \
-       mkdir /opt/apache-doris && \
-       cd /opt && \
-       mv apache-doris-be-x.x.x-bin-x86_64 /opt/apache-doris/be
-
-ADD resource/init_be.sh /opt/apache-doris/be/bin
-ADD resource/entry_point.sh /usr/local/bin
-RUN chmod 755 /usr/local/bin/entry_point.sh
-RUN chmod 755 /opt/apache-doris/be/bin/init_be.sh
+ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${TARGETARCH:-amd64} \
+        PATH="/opt/apache-doris/be/bin:${PATH}"
+
+# apache-doris/be from doris release xxxx.tar.gz.please update the version in 
follows x.x.x.
+ADD resource/apache-doris-x.x.x-bin-${TARGETARCH:-amd64}/be 
/opt/apache-doris/be
+
+COPY resource/be_*.sh /opt/apache-doris/
+
+COPY resource/entry_point.sh /usr/local/bin/
+
+COPY resource/init_be.sh /usr/local/bin/
+
+WORKDIR /opt/apache-doris
 
 ENTRYPOINT ["bash","entry_point.sh"]
diff --git a/docker/runtime/fe/Dockerfile b/docker/runtime/fe/Dockerfile
index 44796e19337..ce1b75c0260 100644
--- a/docker/runtime/fe/Dockerfile
+++ b/docker/runtime/fe/Dockerfile
@@ -16,25 +16,39 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# choose a base image
-FROM openjdk:8u342-jdk
+# how to use Dockerfile.
+# this is dockerfile for build doris fe image on amd64.
+# when build youself image.
+# 1. pull binary from official website and decompress into resource directory 
that the level equals with Dockerfile_be_ubuntu.
+# 2. untar xxxx.tar.gz in resource directory, update the dockerfile field 
`apache-doris-xxx`, replace with real version.
+# 3. run commad docker build -t xxx.doris.be:xx -f Dockerfile_be_ubuntu.
+
+# we have support buildx for amd64 and arm64 architecture image build.
+# get the binary from doris github and utar into resource, update the 
directory as apache-`version(example:2.0.1)`-bin-`architecture(amd64/arm64)` 
mode.
+
+FROM ubuntu:22.04
+
+ARG TARGETARCH
 
 # set environment variables
-ENV JAVA_HOME="/usr/local/openjdk-8/" \
-       PATH="/opt/apache-doris/fe/bin:${PATH}"
-
-# download the software to the mirror and replace it as needed
-ADD ./resource/apache-doris-fe-x.x.x-bin.tar.gz /opt/
-
-# deploy software
-RUN apt-get update && \
-       apt-get install -y default-mysql-client && \
-       apt-get clean && \
-       mkdir /opt/apache-doris && \
-       cd /opt && \
-       mv apache-doris-fe-x.x.x-bin /opt/apache-doris/fe
-
-ADD resource/init_fe.sh /opt/apache-doris/fe/bin
-RUN chmod 755 /opt/apache-doris/fe/bin/init_fe.sh
+ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${TARGETARCH:-amd64} \
+        PATH="/opt/apache-doris/fe/bin:${PATH}"
+
+# apache-doris/fe from doris release tar.gz, please update the version in 
follows x.x.x.
+COPY resource/apache-doris-x.x.x-bin-${TARGETARCH:-amd64}/fe 
/opt/apache-doris/fe
+
+RUN apt-get update -y &&  DEBIAN_FRONTEND=noninteractive apt-get install -y 
--no-install-recommends \
+    patchelf gdb binutils binutils-common mysql-client \
+    curl wget less vim htop iproute2 numactl jq iotop sysstat tzdata \
+    tcpdump iputils-ping dnsutils strace lsof blktrace \
+    bpfcc-tools linux-headers-realtime linux-tools-realtime silversearcher-ag \
+    net-tools openjdk-8-jdk && \
+    rm -rf /var/lib/apt/lists/*
+
+ADD resource/init_fe.sh /opt/apache-doris/fe/bin/
+
+COPY resource/fe_*.sh /opt/apache-doris/
+
+WORKDIR /opt/apache-doris
 
 ENTRYPOINT ["/opt/apache-doris/fe/bin/init_fe.sh"]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to