在镜像生成时从内网获取字体安装包并配置

root@fy_svr# cat Dockerfile-8921

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base

#替换容器镜像的源,用指定的源来下载安装组件

RUN rm -f /etc/apt/sources.list

RUN touch /etc/apt/sources.list

RUN cp /etc/apt/sources.list /etc/apt/sources.list.d/orig.list && \

echo 'deb http://hub.***.com:9081/repository/apt-proxy-debian/ bullseye main contrib non-free' > /etc/apt/sources.list

RUN echo 'deb http://hub.***.com:9081/repository/apt-proxy-debian/ bullseye-updates main contrib non-free' >> /etc/apt/sources.list

RUN echo 'deb http://hub.***.com:9081/repository/apt-proxy-debian/ bullseye-backports main contrib non-free' >> /etc/apt/sources.list

RUN rm -rf /var/lib/apt/lists/*

#RUN mkdir -p /data/ss/server/fonts

RUN mkdir -p /usr/share/fonts

1. 安装字体工具(最小化)

RUN apt-get update && \

apt-get install -y --no-install-recommends \

fontconfig \

fonts-dejavu-core \

fonts-liberation && \

apt-get clean && rm -rf /var/lib/apt/lists/*

2. 复制离线字体(fonts/ 与 Dockerfile 同目录)

COPY fonts/ /usr/share/fonts/truetype/custom/

3. 刷新缓存 & 赋权

RUN chmod -R 755 /usr/share/fonts/truetype/custom && \

fc-cache -fv

WORKDIR /data/docker/app/xa/server5

COPY . /data/docker/app/xa/server5

ENV ASPNETCORE_URLS http://+:8921

EXPOSE 8921

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN echo 'Asia/Shanghai' > /etc/timezone

ENTRYPOINT "dotnet", "QNC.Web.Entry.dll"

相关推荐
tntxia1 天前
linux curl命令详解_curl详解
linux
扛枪的书生2 天前
Linux 网络管理器用法速查
linux
顺风尿一寸2 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
lichenyang4532 天前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang4532 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4532 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4532 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
XIAOHEZIcode2 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫2 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux
AlfredZhao4 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80