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

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"

相关推荐
蹊黎1 小时前
Linux 进程概念(四):命令行参数与环境变量
linux·运维·服务器
AR-26710-5 小时前
docker Day3——镜像,容器,日志与元数据
运维·docker·容器
duansamve11 小时前
docker compose使用详解
docker
蜗牛一步步往上爬11 小时前
第十一章 构建基本脚本
linux
星恒随风12 小时前
从0实现C++ AI大模型接入SDK(二):AI知识科普——从图灵测试到ChatGPT,人工智能的发展历程
linux·c++·人工智能·笔记·chatgpt
飞奔的瓜牛12 小时前
Linux 数据盘分区、格式化与自动挂载完整实践
linux·运维·服务器
csdn_aspnet12 小时前
使用 Docker 运行 Microsoft SQL 数据库服务器
数据库·microsoft·docker·sqlserver
Lucas. Wáng13 小时前
Linux网络编程之网络套接字
linux·服务器·网络
进击的荆棘13 小时前
Linux网络——Socket编程TCP
linux·运维·服务器·网络·tcp/ip
大今野14 小时前
2026 专转本计算机|Linux CentOS7 软件包管理:yum 仓库配置与常用命令考点全解(附例题)
linux·运维·服务器·专转本