gpt4 book ai didi

docker - 无法构建 : Get https://registry-1. docker.io/v2/microsoft/aspnetcore/manifests/1.1:未授权:用户名或密码不正确

转载 作者:IT老高 更新时间:2023-10-28 21:20:20 29 4
gpt4 key购买 nike

我的 aspnetcore docker 项目构建,但是当我单击 Docker 按钮(或按 F5)运行时,我得到了

Severity    Code    Description Project File    Line    Suppression State
Error MSB4018 The "PrepareForLaunch" task failed unexpectedly.
Microsoft.DotNet.Docker.CommandLineClientException: Creating network "dockercompose1627893588_default" with the default driver
Building pswebapi
Service 'pswebapi' failed to build: Get https://registry-1.docker.io/v2/microsoft/aspnetcore/manifests/1.1: unauthorized: incorrect username or password.

For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting ---> Microsoft.DotNet.Docker.CommandLineClientException: Creating network "dockercompose1627893588_default" with the default driver
Building pswebapi
Service 'pswebapi' failed to build: Get https://registry-1.docker.io/v2/microsoft/aspnetcore/manifests/1.1: unauthorized: incorrect username or password
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.DotNet.Docker.DockerComposeClient.<ExecuteAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.DockerWorkspace.<PrepareForLaunchAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.Compose.targets 192

我确实有 C: 使用 Docker 设置共享。我正在使用 linux 容器

Dockerfile 是

FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "PsWebApi.dll"]

我已升级到最新的 nuget 包。

最佳答案

user id对应的email用来登录dockerhub的其实是两个不同的东西在这种情况下。

需要id用户名,而不是email来获取images


解决

通过在两者之间进行切换

> docker 注销

然后在命令行上

> docker 登录

并使用您的 id 登录。

请注意,id 可以在您使用电子邮件登录后在 docker 网站上找到。

系统将提示您输入凭据。同样,对于该用户名,不要使用电子邮件地址。

关于docker - 无法构建 : Get https://registry-1. docker.io/v2/microsoft/aspnetcore/manifests/1.1:未授权:用户名或密码不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44993788/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com