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

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"

相关推荐
未济16 小时前
linux 配置环境变量
linux
傲世仙尊16 小时前
目录即文件-Ext文件系统收尾篇
linux·c语言
虎头金猫16 小时前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
分布式存储与RustFS17 小时前
MinIO 官方 Docker 镜像被移除:依赖它的项目该怎么办
docker·云原生·devops·对象存储·minio·分布式存储
_艾伦 耶格尔.17 小时前
进程间通信
linux
Liuqy-0518 小时前
Linux IO编程——静态库、动态库
linux
彧azz18 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
玉&心19 小时前
通过Arthas在线诊断K8S中的内存及JVM等使用情况
docker·k8s·arthas
xing-xing19 小时前
Docker容器中Nginx站点根目录网页配置访问
nginx·docker
-梅19 小时前
linux(8) 软硬链接
linux·运维·服务器