ubuntu/dotnet-deps当前的dotnet-deps Docker镜像由Canonical提供,基于Ubuntu构建。该镜像会接收安全更新,并滚动更新至新版本的dotnet-deps或Ubuntu发行版。本仓库可免费使用,且不受每用户速率限制影响。
***led Ubuntu for .NET Deps镜像是一个纯净的基础镜像,供开发人员叠加自包含的.NET和ASP.NET应用。详情可参阅.NET文档。该镜像仅包含运行标准自包含.NET应用所需的运行时依赖:ca-certificates、libc6、libgcc、libssl3、libstdc++6和zlib1g。
此镜像不包含bash或包管理器。
如需了解更多关于.NET的精简Ubuntu(一种新型OCI镜像),请访问Ubuntu博客。
Canonical与Microsoft合作提供并支持Ubuntu上的.NET。
若需.NET或ASP.NET运行时镜像,请查看ubuntu/dotnet-runtime和ubuntu/dotnet-aspnet仓库。
!LTS
LTS频道提供长达5年的免费安全维护。
!ESM
ESM提供长达10年的客户安全维护,来自Canonical的受限仓库。
| 频道标签 | 支持截止日期 | 当前版本 | 架构 | |
|---|---|---|---|---|
8.0-24.04_stable | 8.0, 8.0-24.04_154, 8.0-24.04_beta, 8.0-24.04_beta_154, 8.0-24.04_candidate, 8.0-24.04_candidate_154, 8.0-24.04_edge, 8.0-24.04_edge_154, 8.0-24.04_stable_154, 8.0_beta, 8.0_candidate, 8.0_edge, 8.0_stable, beta, candidate, edge, stable | 2026年11月 | Ubuntu 24.04 LTS上的dotnet-deps 8.0 | amd64, arm64, ppc64le, s390x |
9.0-25.04_edge | 9.0-25.04_edge | 2026年1月 | Ubuntu 25.04上的dotnet-deps 9.0 | arm64, amd64 |
track_risk |
频道标签按稳定性排序:stable、candidate、beta、edge。风险更高的频道始终隐含可用,例如若列出beta,则也可拉取edge;若列出candidate,则可拉取beta和edge;若列出stable,则四个频道均可用。镜像会按edge→beta→candidate→stable的顺序更新。
若您的使用涉及商业再分发,或需要ESM或未列出的频道/版本,请联系Canonical团队(或发送邮件至***)。
shdocker run -d --name dotnet-deps-container -e TZ=UTC ubuntu/dotnet-deps:8.0-24.04_stable
对于标签为6.0、8.0和9.0-24.10的镜像,您将看到以下输出:
docker: Error response from daemon: No command specified. See 'docker run --help'.
这是正常现象,因为该镜像没有入口点。
对于标签为9.0-25.04及以上的镜像,您将看到以下输出:
2025-07-17T15:12:33.628Z [pebble] Started daemon. 2025-07-17T15:12:33.653Z [pebble] POST /v1/services 151.275µs 400 (http+unix) 2025-07-17T15:12:33.653Z [pebble] Cannot start default services: no default services
这是因为该镜像是Rock,默认入口点为Pebble,且Rock中未定义默认服务。
dotnet-deps镜像的主要用途是提供基础依赖,以便在其之上叠加自包含的.NET或ASP.NET应用。
以下是多阶段Dockerfile示例:基于Ubuntu 24.04构建ASP.NET应用,并将其打包到ubuntu/dotnet-deps:8.0-24.04_stable之上。
DockerfileFROM ubuntu:24.04 AS builder # 从Ubuntu仓库安装.NET 8 SDK # (无需清理apt缓存,因为此阶段不发布) RUN apt-get update && apt-get install -y dotnet8 ca-certificates # 添加应用代码 WORKDIR /source # 使用示例应用:[***] COPY . . # 导出自包含.NET应用 RUN dotnet publish -c Release -r ubuntu.24.04-x64 --self-contained true -o /app FROM ubuntu/dotnet-deps:8.0-24.04_stable WORKDIR /app COPY --from=builder /app ./ ENTRYPOINT ["/app/dotnetcoresample"]
使用上述Dockerfile构建并运行:
bashgit clone [***] cd dotnetcore-docs-hello-world git checkout 95b862ca3580c82835322d9eb45eb9ecfd731370 # 将上述示例内容复制到./Dockerfile docker build . -t my-***ed-aspnet-app:latest docker run -p 8080:8080 my-***ed-aspnet-app:latest # 访问 http://localhost:8080/
如需构建.NET 9应用并打包到ubuntu/dotnet-deps:9.0-25.04_edge之上,可使用以下Dockerfile:
DockerfileFROM ubuntu:25.04 AS builder # 从Ubuntu仓库安装.NET 9 SDK # (无需清理apt缓存,因为此阶段不发布) RUN apt-get update && apt-get install -y dotnet9 ca-certificates # 添加应用代码 WORKDIR /source # 使用示例应用:[***] COPY . . # 导出自包含.NET应用 RUN dotnet publish -c Release -r ubuntu.25.04-x64 --self-contained true -o /app FROM ubuntu/dotnet-deps:9.0-25.04_edge WORKDIR /app COPY --from=builder /app ./ CMD ["exec", "/app/dotnetcoresample"]
运行命令:
bashgit clone [***] cd dotnetcore-docs-hello-world git checkout 95b862ca3580c82835322d9eb45eb9ecfd731370 sed -i 's/net8.0/net9.0/' dotnetcoresample.csproj # 将上述示例内容复制到./Dockerfile docker build . -t my-***ed-aspnet-app:latest docker run -p 8080:8080 my-***ed-aspnet-app:latest # 访问 http://localhost:8080/
查看容器日志:
shdocker logs -f dotnet-deps-container
如发现镜像bug或需请求功能,请提交bug报告:
[***]
请将bug标题格式化为“dotnet-deps: <问题摘要>”,并包含所用镜像的摘要(通过以下命令获取):
shdocker images --no-trunc --quiet ubuntu/dotnet-deps:<tag>
以下频道(标签)不再更新。请升级至新频道,如无法升级,请联系我们。
| 跟踪 | 版本 | 终止支持日期 | 升级路径 |
|---|---|---|---|
| Ubuntu 24.10上的dotnet-deps 9.0 | 2025年7月 | - | |
| Ubuntu 22.04 LTS上的dotnet-deps 6.0 | 2024年11月 | - | |
| Ubuntu 23.04上的dotnet-deps 7.0 | 2024年5月 | - | |
| Ubuntu 22.10上的dotnet-deps 6.0 | 2023年7月 | - | |
| Ubuntu 23.04上的dotnet-deps 7.0 | 2024年5月 | - | |
| Ubuntu 22.10上的dotnet-deps 6.0 | 2023年7月 | - | |
| Ubuntu 22.10上的dotnet-deps 7.0 | 2023年7月 | - | |
track |

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