首页 > 解决方案 > 适用于 Windows 的 Docker 桌面 - 无法提取图像

问题描述

我在 Windows [Docker 版本 18.09.0,构建 4d60db4] 和 Windows 10 64 位操作系统上使用 Docker Desktop

当我尝试使用命令提取图像时,

docker pull ubuntu

我收到以下错误。

来自守护进程的错误响应:获取https://registry-1.docker.io/v2/:net/http:在等待连接时取消请求(等待标头时超出 Client.Timeout)

对于任何图像,我都会收到上述错误,我尝试拉/运行(甚至是 helloworld 示例图像)

我做了以下事情,

  1. 由于我在公司代理后面,我已经通过设置 -> 代理选项设置了代理信息

  2. 在 Settings -> Network 选项中,我尝试了 DNS 服务器的两个选项( Automatic 和 Fixed [ 8.8.8.8 ] ),然后再次重新启动 docker。

  3. 我还检查了浏览器上的 url [ https://registry-1.docker.io/v2/ ]。我得到以下回复

    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

在 Docker 拉取映像之前,我需要做的任何其他设置/配置?

编辑 1 - 正如建议的那样,我尝试从控制台和 UI 进行 docker login

以下是观察结果

  1. 我可以从我的浏览器登录到https://hub.docker.com/

  2. 当我尝试登录时从控制台,我收到以下错误

来自守护进程的错误响应:获取https://registry-1.docker.io/v2/:net/http:在等待连接时取消请求(等待标头时超出 Client.Timeout)

  1. 通过 UI(通过单击系统托盘图标),当我尝试登录时,出现以下异常,但奇怪的是,当我再次单击系统托盘图标并检查时,它会登录到我的帐户

C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\ClientConfig 中 Docker.WPF.ClientConfig.DockerLogin.SetCredentialInStore(DockerLoginCredential cred) 的 Docker.Core.DockerException \DockerLogin.cs: Docker.WPF.ClientConfig.DockerLogin.OnCredentialChanges(Auth cred) 的第 158 行,位于 C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF \ClientConfig\DockerLogin.cs:C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker 中 Docker.Core.Mediator`1.Raise(T ev) 的第 112 行.Core\Mediator.cs: Docker.WPF.DockerHub.CredentialManager.Store(Credential cred, Credential oAuthCred) 中的第 50 行:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\ src\Docker.WPF\DockerHub\CredentialManager.cs:C 中 Docker.WPF.DockerHub.CredentialManager.d__21.MoveNext() 的第 134 行:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\DockerHub\CredentialManager.cs:第 165 行 --- 堆栈跟踪从先前抛出异常的位置结束 - -- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Docker.WPF.DockerHub.LoginDialog.d__6.MoveNext() 在 C:\workspaces\stable- 18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\DockerHub\LoginDialog.xaml.cs:line 46 --- 堆栈跟踪从先前抛出异常的位置结束---在System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper 的 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()。TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal( ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state ) 在 System.Windows.Threading.DispatcherOperation 的 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)。在 MS.Win32.HwndWrapper.WndProc( IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&handled) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 在 System。 Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg,IntPtr wParam,IntPtr lParam) 在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 在 System.Windows.Window.ShowHelper(Object booleanBox) 在 System.Windows.Window 的 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Systray\DockerHubSystrayGroup.cs 中 Docker.Systray.DockerHubSystrayGroup.OnLoginToDockerHub() 的 .ShowDialog():在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) 的第 249 行。 Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.ShowDialog() at Docker.Systray.DockerHubSystrayGroup.OnLoginToDockerHub() in C:\workspaces\stable-18.09.x \src\github.com\docker\pinata\win\src\Docker.Windows\Systray\DockerHubSystrayGroup.cs:System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms 的第 249 行.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.ShowDialog() at Docker.Systray.DockerHubSystrayGroup.OnLoginToDockerHub() in C:\workspaces\stable-18.09.x \src\github.com\docker\pinata\win\src\Docker.Windows\Systray\DockerHubSystrayGroup.cs:System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms 的第 249 行.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)x\src\github.com\docker\pinata\win\src\Docker.Windows\Systray\DockerHubSystrayGroup.cs: System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows 的第 249 行。 Forms.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)x\src\github.com\docker\pinata\win\src\Docker.Windows\Systray\DockerHubSystrayGroup.cs: System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows 的第 249 行。 Forms.ToolStripMenuItem.OnClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) 在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) 在 System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 在 System .Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ToolStrip.WndProc(Message& m) 在 System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

标签: dockerdocker-machine

解决方案


在你的命令行上你可以试试这个 -

set HTTP_PROXY=http://proxy_userid:proxy_password@proxy_ip:proxy_port

docker pull ubuntu


推荐阅读