赞
踩
ii、添加镜像源
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://l10nt4hq.mirror.aliyuncs.com",
"http://hub-mirror.c.163.com",
"http://mirrors.ustc.edu.cn/",
"http://mirror.azure.cn/"
]
}
ii、重启docker
systemctl restart docker
iii、查看镜像源是否添加成功
docker info | grep -i "mirror
wget https://download.oracle.com/java/17/archive/jdk-17.0.11_linux-x64_bin.tar.gz
simsun.ttc(微软雅黑)
msyh.ttc (常规)
msyhbd.ttc (粗体)
msyhl.ttc(轻体)
直接下载:https://songzixian.lanzouq.com/isrrn179cr1i ,密码:fyxy
# 使用Linux发行版作为基础镜像
FROM centos:7# 镜像作者
MAINTAINER zxx#字体库安装
RUN yum -y install fontconfig
RUN mkdir -p /usr/share/fonts/
COPY ./font/simsun.ttc /usr/share/fonts/
COPY ./font/msyh.ttc /usr/share/fonts/
COPY ./font/msyhbd.ttc /usr/share/fonts/
COPY ./font/msyhl.ttc /usr/share/fonts/
RUN chmod 755 /usr/share/fonts/*
RUN fc-cache -fv#JDK安装
# 解压JDK压缩包
ADD jdk-17_linux-x64_bin.tar.gz /usr/local
# 设置JAVA_HOME环境变量
ENV JAVA_HOME=/usr/local/jdk-17.0.11/
# 将JDK的bin目录添加到PATH环境变量中
ENV CLASSPATH=.:$JAVA_HOME/lib/jrt-fs.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH=$PATH:$JAVA_HOME/bin#校准容器时间
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/timezone#切换容器字体编码
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
RUN echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8#回到主目录, 授权root
WORKDIR /
USER root
docker build -t='jdk:17.0.11' .
docker images
docker run -di --name jdk17 -d jdk:17.0.11
docker exec -it jdk17 /bin/bash
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。