dotnet自定义镜像与linux上直接编译运行
1、查看linux中的版本
dotnet --list-runtimes
2、编辑Dockerfile
echo 'FROM mcr.microsoft.com/dotnet/aspnet:6.0.25 AS runtime
# 添加中文字体到正确的位置
#COPY fonts/ /usr/share/fonts/
#时区
RUN cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo -ne "timezone Asia/Shanghai. (`uname -rsv`)\n" >> /root/.built
WORKDIR /app' > Dockerfile
3、生成镜像
echo 'docker build -t $1 -f Dockerfile .' > build.sh
评论已关闭