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

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"

相关推荐
BI专家之路5 分钟前
安装linux/hadoop/jdk/hive
linux·hive·hadoop
GeW13 小时前
超详细!RHCE10版通用备考策略,内含评分细则解读
linux
用户0413284651313 小时前
Linux 服务开机自启动怎么配置?systemctl enable 原理详解
linux
leeyi18 小时前
把软件装进不能上网的机房——一套建好了、还没上过战场的交付工程(第101篇)
docker·aigc·agent
YIAN20 小时前
Docker + Nginx 核心原理扫盲:从环境隔离到反向代理,运维面试必考点
后端·docker·面试
草莓熊Lotso1 天前
【Redis 初阶】Set 类型深度解析:去重集合的运算能力与实战场景
linux·网络·数据库·windows·redis·tcp/ip·缓存
张文君1 天前
ubuntu26.04坏道坏块分区隔离急速版260831-V0.12
linux·python
IT大白鼠1 天前
Docker 实战 ELKF 日志监控:容器日志全栈收集分析方案
运维·docker·容器
贝锐1 天前
从国产化信创设备到商用安卓终端,向日葵如何帮助企业实现统一运维管理?
linux·运维·远程控制
Julien20041 天前
调查和解决 SELinux 问题
linux·运维·服务器·网络·学习方法