Azure ML任务报错:Debian 11不支持.NET Core 3.1自动依赖
解决Azure ML Docker容器中.NET Core 3.1依赖缺失问题
问题说明
在Azure ML使用STANDARD_DS3_V2集群运行Docker容器训练模型时,基于python:3.9-slim(Debian 11)镜像出现NotImplementedError,提示系统缺少liblttng-ust.so.0、libcurl.so.4包,需手动安装.NET Core 3.1依赖。
修改后的Dockerfile
FROM python:3.9-slim # 安装系统依赖并配置.NET Core源 RUN apt-get update && apt-get install -y --no-install-recommends \ libcurl4 \ liblttng-ust0 \ apt-transport-https \ ca-certificates \ && curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/11/prod bullseye main" > /etc/apt/sources.list.d/microsoft.list \ && apt-get update && apt-get install -y --no-install-recommends dotnet-runtime-3.1.23 \ && apt-get clean && rm -rf /var/lib/apt/lists/* RUN pip install azure-cli RUN az login --service-principal -u "xxxxxxxx" -p "xxxxxx" --tenant "xxxxxx" COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . RUN pip install . --use-feature=fast-deps RUN echo "Finished installing packages."
关键改动说明
- 直接安装报错中提到的缺失系统包
libcurl4和liblttng-ust0,满足基础依赖需求。 - 添加微软官方的.NET Core软件源,Debian 11默认源不包含.NET Core 3.1版本,通过官方源可以获取指定版本的runtime。
- 安装报错提示的
.NET Core 3.1.23 runtime版本,确保与Azure ML dataprep组件依赖匹配。 - 清理apt缓存,避免镜像体积过大。
内容的提问来源于stack exchange,提问作者Niels Hoogeveen
相关产品推荐
相关产品推荐

