FROM centos_s:7.9
RUN echo "Asia/Shanghai" > /etc/timezone && \
sed -i '/aliases/a\alias ls="ls --color=auto"' ~/.bashrc && \
sed -i '/aliases/a\alias ll="ls -al"' ~/.bashrc && \
yum upgrade -y && \
yum install -y telnet net-tools && \
yum install -y zip unzip && \
yum install -y cronie lsof && \
yum -y install kde-l10n-Chinese && \
yum clean all && \
rm -rf /tmp/* /var/cache/yum/* && \
localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LC_ALL zh_CN.UTF-8
----
FROM centos:7.9r1
ADD jdk1.8 /opt/jdk1.8
RUN useradd java
ENV JAVA_HOME=/opt/jdk1.8 \
PATH=$PATH:/opt/jdk1.8/bin:/opt/jdk1.8/jre/bin
---
FROM centos-jdk:7.9-1.8
ADD DEPLOY_PJ_NAME/target/DEPLOY_PJ_NAME.tar.gz DEPLOY_PJ_NAME
RUN chown java.java -R DEPLOY_PJ_NAME/ \
&& echo 'Asia/Shanghai' >/etc/timezone \
&& sed -i "s|nohup ||g" /DEPLOY_PJ_NAME/bin/app.sh \
&& sed -i "s|mkdir -p \$LOG_DIR|mkdir -p \$LOG_DIR/normal_logs|g" /DEPLOY_PJ_NAME/bin/app.sh \
&& sed -i "s| 2>&1 &||g" /DEPLOY_PJ_NAME/bin/app.sh \
&& sed -i "s|NOHUP_FILE=\$LOG_DIR/application.out|NOHUP_FILE=\$LOG_DIR/normal_logs/normal.log|g" /DEPLOY_PJ_NAME/bin/app.sh \
&& cat /DEPLOY_PJ_NAME/bin/app.sh
USER java
CMD sh -c "source /etc/profile && cd /DEPLOY_PJ_NAME && /bin/sh bin/appStart.sh ; tail -f /var/log/wtmp "