简体   繁体   English

Skaffold 开发失败

[英]Skaffold dev fails

I am having this error, after running skaffold dev .运行skaffold dev后出现此错误。

Step 1/6 : FROM node:current-alpine3.11
exiting dev mode because first build failed: unable to stream build output: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.49.1:53: read udp 192.168.49.2:35889->192.168.49.1:53: i/o timeout. Please fix the Dockerfile and try again..

Here is skaffold.yml这是 skaffold.yml

apiVersion: skaffold/v2beta11
kind: Config
metadata:
  name: *****
build:
  artifacts:
    - image: 127.0.0.1:32000/auth
      context: auth
      docker:
        dockerfile: Dockerfile
deploy:
  kubectl:
    manifests:
      - infra/k8s/auth-depl.yaml
  local:
    push: false
  artifacts:
    - image: 127.0.0.1:32000/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: "src/**/*.ts"
            dest: .

I have tried all possible solutions I saw online, including adding 8.8.8.8 as the DNS, but the error still persists.我已经尝试了我在网上看到的所有可能的解决方案,包括将 8.8.8.8 添加为 DNS,但错误仍然存在。 I am using Linux and running ubuntu, I am also using Minikube locally.我正在使用 Linux 并运行 ubuntu,我也在本地使用 Minikube。 Please assist.请协助。

This is a Community Wiki answer, posted for better visibility, so feel free to edit it and add any additional details you consider important.这是一个社区 Wiki 答案,已发布以提高可见性,因此请随时对其进行编辑并添加您认为重要的任何其他详细信息。

In this case:在这种情况下:

minikube delete && minikube start

solved the problem but you can start from restarting docker daemon .解决了问题,但您可以从重新启动docker daemon开始。 Since this is Minikube cluster and Skaffold uses for its builds Minikube's Docker daemon , as suggested by Brian de Alwis in his comment, you may start from:由于这是Minikube集群,并且Skaffold用于构建Minikube 的 Docker 守护进程,正如Brian de Alwis在他的评论中所建议的那样,您可以从:

minikube stop && minikube start

or或者

minikube ssh
su
systemctl restart docker

I searched for similar errors and in many cases eg here or in this thread , setting up your DNS to something reliable like 8.8.8.8 may also help:我搜索了类似的错误,并且在许多情况下,例如在这里在这个线程中,将您的 DNS 设置为像8.8.8.8这样可靠的东西也可能会有所帮助:

sudo echo "nameserver 8.8.8.8" >> /etc/resolv.conf

in case you use Minikube you should first:如果您使用Minikube ,您应该首先:

minikube ssh

su ### to become root

and then run:然后运行:

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

The following error message:以下错误消息:

Please fix the Dockerfile and try again

may be somewhat misleading in similar cases as Dockerfile is probably totally fine, but as we can read in other part:在类似情况下可能会有些误导,因为Dockerfile可能完全没问题,但我们可以在其他部分阅读:

lookup registry-1.docker.io on 192.168.49.1:53: read udp 192.168.49.2:35889->192.168.49.1:53: i/o timeout.

it's definitely related with failing DNS lookup.这肯定与 DNS 查找失败有关。 This is well described here as well known issue.在此处作为众所周知的问题进行了很好的描述。

Get i/o timeout获取 i/o 超时

Get https://index.docker.io/v1/repositories/ /images: dial tcp: lookup on:53: read udp:53: i/o timeout Get https://index.docker.io/v1/repositories/ /images: dial tcp: lookup on:53: read udp:53: i/o timeout

Description描述

The DNS resolver configured on the host cannot resolve the registry's hostname.主机上配置的 DNS 解析器无法解析注册表的主机名。

GitHub link GitHub链接

N/A不适用

Workaround解决方法

Retry the operation, or if the error persists, use another DNS resolver.重试该操作,或者如果错误仍然存在,请使用另一个 DNS 解析器。 You can do this by updating your /etc/resolv.conf file with these or other DNS servers:您可以通过使用这些或其他 DNS 服务器更新您的/etc/resolv.conf文件来做到这一点:

nameserver 8.8.8.8 nameserver 8.8.4.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM