Files
kenaito-lab/image/runtime-dotnet9/Dockerfile
T
odboy c9ead5f038 refactor: .NET 镜像改为 build.sh 预下载 SDK/运行时,精简依赖并补充忽略文件
- compile/runtime dotnet6/8/9:ADD 本地 tar.gz 替代 ADD 远程 URL,压缩包由
  build.sh 先下载(带缓存判断),避免构建时重复下载与层缓存失效
- 精简 yum 依赖:compile 镜像保留 gcc/make,runtime 镜像去掉编译工具链;
  统一补装 libicu(.NET 全球化必需,缺失时 dotnet 命令直接 Abort)
- 每个镜像目录新增 .dockerignore(不忽略 *.tar.gz,因需在构建上下文内)与 .gitignore
- build.sh 加 shebang、set -euo pipefail,并 cd 到脚本所在目录,加可执行权限
- system-alinux3:设置时区软链,aliyun 镜像源域名修正为 mirrors.aliyun.com
2025-11-22 21:03:22 +08:00

17 lines
664 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM registry.cn-shanghai.aliyuncs.com/odboy/kenaito:system-alinux3
LABEL MAINTAINER="tianjun@odboy.cn"
ENV TimeZone=Asia/Shanghai
ENV DOTNET_HOME=/usr/local/dotnet
ENV PATH="${DOTNET_HOME}:$PATH"
WORKDIR /home/admin
# https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-9.0.0-rc.2-linux-x64-binaries
# 由 build.sh 预先下载到本目录
ADD aspnetcore-runtime-9.0.0-rc.2.24474.3-linux-x64.tar.gz /usr/local/dotnet/
# sysstat/net-tools 用于排障
# libicu:.NET 全球化(CultureInfo/TimeZoneInfo)必需,缺了 dotnet 命令会直接 Abort
RUN yum install \
libicu \
sysstat \
net-tools -y; \
dotnet --info;