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

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"

相关推荐
雾时之林8 小时前
Linux---计算机网络常见面试题
linux·运维·计算机网络
10mAh9 小时前
【Linux】error while loading shared libraries 怎么解决?——ldd、RPATH 与动态链接排错
java·linux·前端
承渊政道9 小时前
飞牛NAS部署Immich:搭建家庭相册并实现远程访问
运维·服务器·docker·内网穿透·cpolar·nas·immich
x-cmd9 小时前
用 Rust 打造 AI 时代的 SQL:把重复任务变成可执行文件
数据库·人工智能·sql·ai·容器·rust·workflow
楷哥爱开发9 小时前
如何在 Windows、macOS 和 Linux 上安装 scikit-learn (sklearn)
linux·windows·macos
十年磨一剑~9 小时前
CAAM不落盘存储密钥方式处理
linux·ubuntu
zhangrelay9 小时前
ROS 2 Lyrical 第2章 ROS 2系统架构与核心概念
linux·笔记·学习·ubuntu·ros2
ruofu339 小时前
如何让docker使用提前下载好的镜像,而不是在线拉取
java·spring cloud·docker
橘色的喵9 小时前
EventPool 32-bit 带标签 CAS 池:RT-Thread 单核 + Linux 双平台无锁
linux·运维·服务器
buhuizhiyuci10 小时前
【Linux 网络篇】数据的 “循环系统“:协议认识与网络传输的流程
linux·运维·服务器·网络·vscode