首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法在码头安装dotnet-符号

无法在码头安装dotnet-符号
EN

Stack Overflow用户
提问于 2021-12-17 10:53:21
回答 1查看 322关注 0票数 1

Dockerfile:

代码语言:javascript
运行
复制
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
RUN dotnet tool install --global dotnet-dump
RUN dotnet tool install --global dotnet-symbol

以及来自docker命令的输出:

代码语言:javascript
运行
复制
docker build -t dotnetdump .
Sending build context to Docker daemon  1.113MB
Step 1/3 : FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
 ---> c7bc3a292fb8
Step 2/3 : RUN dotnet tool install --global dotnet-dump
 ---> Running in 64fdd40c84ba
Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:/root/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:/root/.dotnet/tools"

You can invoke the tool using the following command: dotnet-dump
Tool 'dotnet-dump' (version '6.0.257301') was successfully installed.
Removing intermediate container 64fdd40c84ba
 ---> d7c9621f15cc
Step 3/3 : RUN dotnet tool install --global dotnet-symbol
 ---> Running in 4e364c8c6e5e
/usr/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error : Failed to retrieve information about 'dotnet-symbol' from remote source 'https://api.nuget.org/v3-flatcontainer/dotnet-symbol/index.json'. [/tmp/ngnhhqca.szt/restore.csproj]
/usr/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error :   Name does not resolve (api.nuget.org:443) [/tmp/ngnhhqca.szt/restore.csproj]
/usr/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error :   Name does not resolve [/tmp/ngnhhqca.szt/restore.csproj]
The tool package could not be restored.
Tool 'dotnet-symbol' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
The command '/bin/sh -c dotnet tool install --global dotnet-symbol' returned a non-zero code: 1

为什么我不能安装dotnet-符号?似乎这是一个点网工具,而且它确实存在-我不明白.

在MacOS上使用Desktop 2.1.0.4

编辑:包含的输出,它验证了docker可以连接到nuget API:

代码语言:javascript
运行
复制
$ docker build -t dotnetdump .
Sending build context to Docker daemon  1.113MB
Step 1/4 : FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine
 ---> 9d2c47a10a43
Step 2/4 : RUN dotnet tool install --global dotnet-dump
 ---> Using cache
 ---> 2441676e9983
Step 3/4 : RUN curl https://api.nuget.org
 ---> Running in 01e48ec9ab73
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   351    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid.
RequestId:bc45b7b2-b01e-0018-32a8-f5ce11000000
100   351  100   351    0     0    542      0 --:--:-- --:--:-- --:--:--   542
Time:2021-12-20T13:50:40.5285563Z</Message><QueryParameterName>comp</QueryParameterName><QueryParameterValue /><Reason /></Error>Removing intermediate container 01e48ec9ab73
 ---> 8db3dda34a98
Step 4/4 : RUN dotnet tool install --global dotnet-symbol
 ---> Running in a417cb9965be
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/tmp/oo0ekzsf.d50/restore.csproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error :   Name does not resolve (api.nuget.org:443) [/tmp/oo0ekzsf.d50/restore.csproj]
/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error :   Name does not resolve [/tmp/oo0ekzsf.d50/restore.csproj]
The tool package could not be restored.
Tool 'dotnet-symbol' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
The command '/bin/sh -c dotnet tool install --global dotnet-symbol' returned a non-zero code: 1
EN

Stack Overflow用户

发布于 2021-12-17 14:49:28

查看错误消息的这一部分:

代码语言:javascript
运行
复制
Name does not resolve (api.nuget.org:443)

看来您的容器无法连接到api.nuget.org。这就是你需要解决的问题。

您的容器可以连接到nuget.org吗?或者其他网站?你在防火墙后面阻止连接吗?您需要配置代理服务器吗?

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70392044

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档