Skip to content

Commit

Permalink
Merge pull request #3 from Le1a/main
Browse files Browse the repository at this point in the history
Use open-jdk8u44
  • Loading branch information
Ar3h authored Nov 7, 2024
2 parents 9eef628 + 1ea6d57 commit 7c55d52
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ RUN unset http_proxy https_proxy ftp_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY && \
echo 'Acquire::http::Proxy "false";' > /etc/apt/apt.conf.d/00proxy && \
echo 'Acquire::https::Proxy "false";' >> /etc/apt/apt.conf.d/00proxy

# 更新系统并安装必要的依赖,包括 libc6、wget 和 openjdk-8-jdk
# 更新系统并安装必要的依赖,包括 libc6、wget
RUN apt-get update && \
apt-get install -y libc6 wget openjdk-8-jdk && \
apt-get install -y libc6 wget && \
rm -rf /var/lib/apt/lists/*

# 下载、解压 Java 安装目录
RUN wget https://download.java.net/openjdk/jdk8u44/ri/openjdk-8u44-linux-x64.tar.gz && \
tar -zxvf openjdk-8u44-linux-x64.tar.gz

# 创建应用目录
RUN mkdir /app && \
mkdir /opt/java

RUN mv java-se-8u44-ri /opt/java/

# 设置 JAVA_HOME 环境变量
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV JAVA_HOME=/opt/java/java-se-8u44-ri
ENV PATH=$JAVA_HOME/bin:$PATH

# 创建应用目录
RUN mkdir /app

# 设置工作目录
WORKDIR /app
Expand All @@ -35,4 +43,4 @@ EXPOSE 8011

# 启动命令,后台运行 Java 应用并输出日志
CMD nohup java -jar /app/web-chains-1.0.0-SNAPSHOT.jar > output.log 2>&1 & \
tail -f output.log
tail -f output.log

0 comments on commit 7c55d52

Please sign in to comment.