From d2dddb2cd0f1880bfba23934befbc7f8fd6e0b16 Mon Sep 17 00:00:00 2001 From: kaede10 Date: Mon, 29 Jul 2024 16:30:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BD=BF=E7=94=A8openeuler=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DockerFile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/DockerFile b/DockerFile index dc977a9..be04eef 100644 --- a/DockerFile +++ b/DockerFile @@ -1,13 +1,26 @@ -FROM openjdk:8-jdk +FROM openeuler/openeuler:22.03 RUN mkdir -p /var/lib/om-kafka WORKDIR /var/lib/om-kafka -COPY . /var/lib/om-kafka -# Install basic software support -RUN apt-get update && \ - apt-get install --yes software-properties-common +RUN yum install -y wget \ + && wget https://mirrors-i.tuna.tsinghua.edu.cn/Adoptium/17/jdk/x64/linux/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz \ + && tar -zxvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz \ + && wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \ + && tar -xzvf apache-maven-3.8.8-bin.tar.gz \ + && yum install -y git + +ENV JAVA_HOME=/var/lib/om-kafka/jdk-17.0.12+7 +ENV PATH=${JAVA_HOME}/bin:$PATH + +ENV MAVEN_HOEM=/var/lib/om-kafka/apache-maven-3.8.8 +ENV PATH=$MAVEN_HOEM/bin:$PATH +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 + +WORKDIR /var/lib/om-kafka +COPY . /var/lib/om-kafka RUN wget https://mirror-hk.koddos.net/apache/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz && \ tar -xzvf apache-maven-3.8.8-bin.tar.gz From cad73abf913bf495c53804918115980d6d80fb5e Mon Sep 17 00:00:00 2001 From: kaede10 Date: Mon, 29 Jul 2024 16:49:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=8E=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E8=AF=BB=E5=8F=96=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DockerFile | 2 ++ src/main/java/Utils/PropertiesUtils.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DockerFile b/DockerFile index be04eef..deb5bd8 100644 --- a/DockerFile +++ b/DockerFile @@ -22,6 +22,8 @@ ENV LC_ALL C.UTF-8 WORKDIR /var/lib/om-kafka COPY . /var/lib/om-kafka +ENV CONFIG_PATH=/opt/config/conf.properties + RUN wget https://mirror-hk.koddos.net/apache/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz && \ tar -xzvf apache-maven-3.8.8-bin.tar.gz diff --git a/src/main/java/Utils/PropertiesUtils.java b/src/main/java/Utils/PropertiesUtils.java index 5d41458..6d70e8b 100644 --- a/src/main/java/Utils/PropertiesUtils.java +++ b/src/main/java/Utils/PropertiesUtils.java @@ -16,7 +16,7 @@ public static Properties readProperties() throws IOException { synchronized (Properties.class){ if(properties==null){ properties=new Properties(); - InputStream resourceAsStream = new FileInputStream(System.getProperty("user.dir") +"/conf.properties"); + InputStream resourceAsStream = new FileInputStream(System.getenv("CONFIG_PATH")); properties.load(resourceAsStream); } }