ubuntu/dotnet-aspnet本镜像为 Canonical 提供的基于 Ubuntu 的 dotnet-aspnet Docker 镜像,专为 ASP.NET 应用提供轻量级运行时环境。镜像会持续接收安全更新,并滚动升级至更新的 dotnet-aspnet 版本或 Ubuntu 发行版。该仓库可免费使用,且免除每用户速率限制。作为 ***led Ubuntu 系列镜像的一部分,其设计目标是提供精简、安全的运行时环境,适合生产环境中部署 ASP.NET 应用。
stable(最稳定)、candidate、beta、edge(最前沿)。风险较高的通道(如 edge)隐含可用,例如若列出 beta,则 edge 也可拉取。镜像会按 edge → beta → candidate → stable 顺序发布。支持 amd64、arm64、ppc64le、s390x 等主流架构(具体架构因版本而异,详见标签说明)。
| 通道标签 | 支持期限 | 当前版本 | 架构支持 |
|---|---|---|---|
8.0-24.04_stable(含衍生标签如 8.0、8.0_stable、stable 等) | 11/2026 | dotnet-aspnet 8.0 on Ubuntu 24.04 LTS | amd64、arm64、ppc64le、s390x |
9.0-25.04_edge | 01/2026 | dotnet-aspnet 9.0 on Ubuntu 25.04 | amd64、arm64 |
通道说明:表中列出的是各版本最稳定的通道,按
stable→candidate→beta→edge排序。风险较高的通道隐含可用(如stable通道可用时,candidate、beta、edge均可用)。镜像会严格按edge→beta→candidate→stable顺序发布。
若需商业再分发、ESM 支持或访问未公开的通道/版本,请联系 Canonical 团队(官方联系方式 或发送邮件至 ***)。
shdocker run -d --name dotnet-aspnet-container -e TZ=UTC ubuntu/dotnet-aspnet:8.0-24.04_stable
说明:默认情况下,容器会输出 .NET 帮助信息,因为需要指定应用程序路径(详见下文“运行 ASP.NET 应用”)。
此类镜像基于 Dockerfile 构建,入口点为 dotnet:
sh# 示例:运行 8.0-24.04_stable 版本 docker run -d --name dotnet-aspnet-container -e TZ=UTC ubuntu/dotnet-aspnet:8.0-24.04_stable # 查看日志(输出 .NET 帮助信息) docker logs -f dotnet-aspnet-container
此类镜像为 Rock 格式,入口点变更为 pebble enter,需通过 exec 命令访问 dotnet:
sh# 示例:运行 9.0-25.04_edge 版本并执行 dotnet docker run --rm ubuntu/dotnet-aspnet:9.0-25.04_edge exec dotnet
以示例应用 Azure-Samples/dotnetcore-docs-hello-world 为例,说明部署步骤。
bash# 克隆示例代码 git clone [***] cd dotnetcore-docs-hello-world # 切换至兼容 .NET 8.0 的提交 git checkout 95b862ca3580c82835322d9eb45eb9ecfd731370 # 发布应用(需本地安装 dotnet8 包) dotnet publish -c Release -o /app --self-contained false # 运行容器(映射应用目录和端口) docker run --rm -v $PWD/app:/app -p 8080:8080 ubuntu/dotnet-aspnet:8.0-24.04_stable /app/HelloWorld.dll
访问应用:localhost:8080
bash# 克隆示例代码 git clone [***] cd dotnetcore-docs-hello-world # 切换至兼容 .NET 8.0 的提交并修改项目文件以支持 .NET 9 git checkout 95b862ca3580c82835322d9eb45eb9ecfd731370 sed -i 's/net8.0/net9.0/' dotnetcoresample.csproj # 发布应用(需本地安装 dotnet9 包) dotnet publish -c Release -o /app --self-contained false # 运行容器(映射应用目录和端口) docker run --rm -v $PWD/app:/app -p 8080:8080 ubuntu/dotnet-aspnet:9.0-25.04_edge /app/HelloWorld.dll
访问应用:localhost:8080
dockerfile# 构建阶段:使用 Ubuntu 24.04 安装 .NET SDK FROM ubuntu:24.04 AS builder RUN apt-get update && apt-get install -y dotnet8 ca-certificates WORKDIR /source COPY . . RUN dotnet publish -c Release -o /app --self-contained false # 运行阶段:使用 ***led Ubuntu 镜像 FROM ubuntu.azurecr.io/dotnet-aspnet:8.0-24.04_stable WORKDIR /app COPY --from=builder /app ./ ENV PORT 8080 EXPOSE 8080 ENTRYPOINT ["dotnet", "/app/dotnetcoresample.dll"]
dockerfile# 构建阶段:使用 Ubuntu 25.04 安装 .NET SDK FROM ubuntu:25.04 AS builder RUN apt-get update && apt-get install -y dotnet9 ca-certificates WORKDIR /source COPY . . RUN sed -i 's/net8.0/net9.0/' dotnetcoresample.csproj # 修改项目文件以支持 .NET 9 RUN dotnet publish -c Release -r ubuntu.25.04-x64 --self-contained false -o /app # 运行阶段:使用 Rock 格式镜像 FROM ubuntu/dotnet-aspnet:9.0-25.04_edge WORKDIR /app COPY --from=builder /app ./ CMD ["exec", "dotnet", "/app/dotnetcoresample.dll"]
查看容器日志:
shdocker logs -f dotnet-aspnet-container
若发现镜像 bug 或需请求功能,请通过以下链接提交 issue:
[***]
提交要求:
dotnet-aspnet: <问题摘要>shdocker images --no-trunc --quiet ubuntu/dotnet-aspnet:<tag>
以下通道/标签不再更新,请升级至新版本或联系 Canonical 获取支持。
| 跟踪(Track) | 版本 | 生命周期结束(EOL) | 升级路径 |
|---|---|---|---|
| dotnet-aspnet 9.0 on Ubuntu 24.10 | 07/2025 | - | |
| dotnet-aspnet 6.0 on Ubuntu 22.04 LTS | 11/2024 | - | |
| dotnet-aspnet 7.0 on Ubuntu 23.04 | 05/2024 | - | |
| dotnet-aspnet 6.0 on Ubuntu 22.10 | 07/2023 | - | |
| dotnet-aspnet 7.0 on Ubuntu 22.10 | 07/2023 | - |



manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务