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

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"

相关推荐
小p1 天前
docker学习: 1. docker基本使用
docker
崔小汤呀2 天前
Docker部署Nacos
docker·容器
缓解AI焦虑2 天前
Docker + K8s 部署大模型推理服务:资源划分与多实例调度
docker·容器
崔小汤呀2 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应2 天前
vi编辑器使用
linux·后端·操作系统
何中应2 天前
Linux进程无法被kill
linux·后端·操作系统
何中应2 天前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应2 天前
Linux常用命令
linux·操作系统
葛立国2 天前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux
1candobetter2 天前
Docker Compose Build 与 Up 的区别:什么时候必须重建镜像
docker·容器·eureka