如何解决docker 无法拉取基础镜像 |获取 https://registry-1.docker.io/v2/:
我正在尝试使用我的构建管道构建一个 docker 镜像,但是 docker 无法拉取基本镜像 我的构建管道托管在 azure devops 服务器中 Windows Server 2019 VM 内托管的 Azure DevOps 服务器
2021-03-04T06:58:21.6816037Z ==============================================================================
2021-03-04T06:58:21.6816138Z Task : Docker
2021-03-04T06:58:21.6816209Z Description : Build,tag,push,or run Docker images,or run a Docker command. Task can be used with Docker or Azure Container registry.
2021-03-04T06:58:21.6816271Z Version : 0.3.24
2021-03-04T06:58:21.6816322Z Author : Microsoft Corporation
2021-03-04T06:58:21.6816387Z Help : [More information](https://go.microsoft.com/fwlink/?linkid=848006)
2021-03-04T06:58:21.6816465Z ==============================================================================
2021-03-04T06:58:22.7477068Z [command]"C:\Program Files\Docker\docker.exe" build -f C:\myagent_agent\_work\7\s\hello-solution\core\Infrastructure\Docker\build\5910\Dockerfile -t myregistry.azurecr.io/myapp-hello:276 C:\heisoul2_agent\_work\7\s\hello-solution\core\Infrastructure\Docker\build\5910
2021-03-04T06:58:26.3591773Z Sending build context to Docker daemon 154.9MB
2021-03-04T06:58:26.3592364Z
2021-03-04T06:58:26.3701800Z Step 1/19 : FROM tomcat:9.0.41-jdk15-openjdk-slim-buster
2021-03-04T06:58:41.7345125Z Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2021-03-04T06:58:41.7599411Z ##[error]C:\Program Files\Docker\docker.exe Failed with return code: 1
2021-03-04T06:58:41.7613038Z ##[section]Finishing: Build an image
Docker 桌面窗口平移未在资源部分显示选项
解决方法
由于目标不可达问题而遇到此错误。这意味着该端口可能被本地或外部防火墙过滤,可能是机器的 DNS 设置有问题。
但是在我的 docker 桌面窗口中,我看不到 非常奇怪的网络选项
对于此问题,网络选项卡在 Windows 容器模式下不可用,因为网络由 Windows 管理。这在官方document中有说明。
有关更改 Windows DNS 地址的详细说明here(请参阅第 II 部分)。
此 document 是关于配置容器 DNS,本节中的信息说明在 Docker 默认 bridge
中配置容器 DNS。
这里有一些票证(ticket1,ticket2),您可以参考相同的问题。
,我在 azure-pipeline.yml 的 dockertask 中使用了 buildArguments
buildArguments: 'http_proxy=http://username:password@proxy:80'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。