spylyt 2020-06-06
dockerfile内容如下:
FROM centos:7
MAINTAINER
RUN yum install telnet nc wget curl unzip iproute net-tools -y && \
yum clean all && \
rm -rf /var/cache/yum/*
#解决时区问题
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
#解决中文乱码问题
RUN yum install kde-l10n-Chinese -y
ENV LANG zh_CN.uft8
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.UFT-8 \
&& echo ‘LANG="zh_CN.uft8"‘ > /etc/locale.conf \
&& source /etc/locale.conf
COPY jdk-8u251-linux-x64.tar.gz /usr/local/
RUN tar -zxf /usr/local/jdk-8u251-linux-x64.tar.gz -C /usr/local/ \
&& rm -rf /usr/local/jdk-8u251-linux-x64.tar.gz
ENV JAVA_HOME=/usr/local/jdk1.8.0_251
ENV JRE_HOME=/usr/local/jdk1.8.0_251/jre
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
ENV PATH $PATH:$JAVA_HOME/bin:$JRE_HOME/bin
构建命令:
docker build -t 10.0.0.100/dev:v1 .
由于现在jdk需要申请账号登录才能下载,本人已经将下载好的jdk镜像上传百度云盘,以供下载。
jdkjdk-8u251-linux-x64.tar.gz 镜像下载链接:
链接:https://pan.baidu.com/s/1wY5E-TbgmT-LZp8iqMh_Vg
提取码:mebr